From 1453b45b083a5075940872cac5f536c47693cbad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan=20Durgun?= Date: Tue, 2 Jan 2024 13:27:46 +0300 Subject: [PATCH] chore: Update copyright header and protos (#72) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oğuzhan Durgun --- buf.lock | 16 +- fetch_protos.sh | 2 +- protos/buf/validate/validate.proto | 2701 +++++++++-------- protos/cerbos/audit/v1/audit.proto | 2 +- protos/cerbos/effect/v1/effect.proto | 2 +- protos/cerbos/engine/v1/engine.proto | 2 +- protos/cerbos/policy/v1/policy.proto | 2 +- protos/cerbos/request/v1/request.proto | 2 +- protos/cerbos/response/v1/response.proto | 5 +- protos/cerbos/schema/v1/schema.proto | 2 +- protos/cerbos/svc/v1/svc.proto | 2 +- protos/cerbos/telemetry/v1/telemetry.proto | 2 +- src/Buf/Validate/AnyRules.php | 96 +- src/Buf/Validate/BoolRules.php | 56 +- src/Buf/Validate/BytesRules.php | 864 +++--- src/Buf/Validate/DoubleRules.php | 346 +-- src/Buf/Validate/DurationRules.php | 380 +-- src/Buf/Validate/EnumRules.php | 384 +-- src/Buf/Validate/FieldConstraints.php | 348 ++- src/Buf/Validate/Fixed32Rules.php | 364 +-- src/Buf/Validate/Fixed64Rules.php | 364 +-- src/Buf/Validate/FloatRules.php | 372 +-- src/Buf/Validate/Int32Rules.php | 358 +-- src/Buf/Validate/Int64Rules.php | 364 +-- src/Buf/Validate/MapRules.php | 296 +- src/Buf/Validate/MessageConstraints.php | 104 +- src/Buf/Validate/OneofConstraints.php | 120 +- src/Buf/Validate/RepeatedRules.php | 332 +- src/Buf/Validate/SFixed32Rules.php | 364 +-- src/Buf/Validate/SFixed64Rules.php | 364 +-- src/Buf/Validate/SInt32Rules.php | 328 +- src/Buf/Validate/SInt64Rules.php | 364 +-- src/Buf/Validate/StringRules.php | 1879 +++++++----- src/Buf/Validate/TimestampRules.php | 286 +- src/Buf/Validate/UInt32Rules.php | 364 +-- src/Buf/Validate/UInt64Rules.php | 364 +-- .../Response/V1/CheckResourcesResponse.php | 27 + .../Response/V1/PlanResourcesResponse.php | 27 + .../Svc/V1/CerbosAdminServiceClient.php | 2 +- .../Svc/V1/CerbosPlaygroundServiceClient.php | 2 +- src/Cerbos/Svc/V1/CerbosServiceClient.php | 2 +- src/GPBMetadata/Buf/Validate/Validate.php | Bin 49975 -> 50787 bytes .../Cerbos/Response/V1/Response.php | 12 +- src/Sdk/Builder/AttributeValue.php | 2 +- src/Sdk/Builder/AuxData.php | 2 +- src/Sdk/Builder/CerbosClientBuilder.php | 2 +- src/Sdk/Builder/CheckResourcesRequest.php | 2 +- src/Sdk/Builder/PlanResourcesRequest.php | 2 +- src/Sdk/Builder/Principal.php | 2 +- src/Sdk/Builder/Resource.php | 2 +- src/Sdk/Builder/ResourceEntry.php | 2 +- src/Sdk/CerbosClient.php | 2 +- .../CheckResourcesResponse.php | 2 +- .../ResultEntry/Meta.php | 2 +- .../ResultEntry/ResultEntry.php | 2 +- .../V1/PlanResourcesResponse/Meta.php | 2 +- .../PlanResourcesResponse.php | 2 +- src/Sdk/Utility/Metadata.php | 2 +- src/Sdk/Utility/RequestId.php | 2 +- tests/CerbosClientTest.php | 2 +- tests/Sdk/Builder/AuxDataTest.php | 2 +- .../Sdk/Builder/CheckResourcesRequestTest.php | 2 +- tests/Sdk/Builder/PrincipalTest.php | 2 +- tests/Sdk/Builder/ResourceEntryTest.php | 2 +- tests/Sdk/Builder/ResourceTest.php | 2 +- tests/TestCase.php | 2 +- 66 files changed, 6455 insertions(+), 5864 deletions(-) diff --git a/buf.lock b/buf.lock index ca01910..362b4eb 100644 --- a/buf.lock +++ b/buf.lock @@ -4,20 +4,20 @@ deps: - remote: buf.build owner: bufbuild repository: protovalidate - commit: 63dfe56cc2c44cffa4815366ba7a99c0 - digest: shake256:5a8a9856b92bf37171d45ccbe59fc48ea755cd682317b088cdf93e8e797ecf54039e012ece9a17084bb676e70c2e090296b2790782ebdbbedc7514e9b543e6bf + commit: e097f827e65240ac9fd4b1158849a8fc + digest: shake256:f19252436fd9ded945631e2ffaaed28247a92c9015ccf55ae99db9fb3d9600c4fdb00fd2d3bd7701026ec2fd4715c5129e6ae517c25a59ba690020cfe80bf8ad - remote: buf.build owner: cerbos repository: cerbos-api - commit: b606e6ef845f444d8ed92bd056379fbc - digest: shake256:bda7486ec7d954aab87dcea22e58381c78ad0c079f1b72331558f064cbd0664109b0a8f71a4c8411a29206181fe93ea90e96586edcdf38865acbe971cba99b48 + commit: f68054407be34c5f9de72b58253186b2 + digest: shake256:34807b5aa37ddd25985d781c0ff91f4e6c130eb265d84f785f2e23185660a8192cb7107fad21c1bc51ed92b04ab59ce1ef036ea459d058de01a1907f4ce6aec3 - remote: buf.build owner: googleapis repository: googleapis - commit: 28151c0d0a1641bf938a7672c500e01d - digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de + commit: b30c5775bfb3485d9da2e87b26590ac9 + digest: shake256:9d0caaf056949a0e1c883b9849d8a2fa66e22f18a2a48f867d1a8c700aa22abee50ad3ef0d8171637457cadc43c584998bdf3adac55da0f9e4614c72686b057d - remote: buf.build owner: grpc-ecosystem repository: grpc-gateway - commit: 048ae6ff94ca4476b3225904b1078fad - digest: shake256:e5250bf2d999516c02206d757502b902e406f35c099d0e869dc3e4f923f6870fe0805a9974c27df0695462937eae90cd4d9db90bb9a03489412560baa74a87b6 + commit: 3f42134f4c564983838425bc43c7a65f + digest: shake256:3d11d4c0fe5e05fda0131afefbce233940e27f0c31c5d4e385686aea58ccd30f72053f61af432fa83f1fc11cda57f5f18ca3da26a29064f73c5a0d076bba8d92 diff --git a/fetch_protos.sh b/fetch_protos.sh index 5e18ad2..f723088 100755 --- a/fetch_protos.sh +++ b/fetch_protos.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2021-2023 Zenauth Ltd. +# Copyright (c) 2021-2024 Zenauth Ltd. # SPDX-License-Identifier: Apache-2.0 # diff --git a/protos/buf/validate/validate.proto b/protos/buf/validate/validate.proto index 2e18adc..6d11ea6 100644 --- a/protos/buf/validate/validate.proto +++ b/protos/buf/validate/validate.proto @@ -60,7 +60,7 @@ extend google.protobuf.FieldOptions { // 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. message MessageConstraints { - // disabled is a boolean flag that, when set to true, nullifies any validation rules for this message. + // `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 @@ -71,97 +71,110 @@ message MessageConstraints { // ``` optional bool disabled = 1; - // cel is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message. + // `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; - //} - //``` + // ```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; + // } + // ``` repeated Constraint cel = 3; } // The `OneofConstraints` message type enables you to manage constraints for -// oneof fields in your protobuf messages. Use the `required` constraint to ensure -// that exactly one of the fields within a oneof is set; validation will fail -// if none of the fields in the oneof are set: +// oneof fields in your protobuf messages. message OneofConstraints { - //`required` is an optional boolean attribute that ensures that - //exactly one of the field options in a oneof is set; validation fails if - //no fields in the oneof are set. - // - //```proto - //message MyMessage { - // oneof value { - // // The field `a` or `b` must be set. - // option (buf.validate.oneof).required = true; - // optional string a = 1; - // optional string b = 2; - // } - //} - //``` + // 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; + // } + // } + // ``` optional bool required = 1; } // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. message FieldConstraints { - // `Constraint` is a repeated field used to represent a textual expression + // `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", - // }]; - //} - //``` + // ```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", + // }]; + // } + // ``` repeated Constraint cel = 23; - //`skipped` is an optional boolean attribute that specifies that the - //validation rules of this field should not be evaluated. If skipped is set to - //true, any validation rules set for the field will be ignored. - // - //```proto - //message MyMessage { - // // The field `value` must not be set. - // optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; - //} - //``` + // `skipped` is an optional boolean attribute that specifies that the + // validation rules of this field should not be evaluated. If skipped is set to + // true, any validation rules set for the field will be ignored. + // + // ```proto + // message MyMessage { + // // The field `value` must not be set. + // optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; + // } + // ``` bool skipped = 24; - //`required` is an optional boolean attribute that specifies that - //this field must be set. If required is set to true, the field value must - //not be empty; otherwise, an error message will be generated. - // - //```proto - //message MyMessage { - // // The field `value` must be set. - // optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; - //} - //``` + // If `required` is true, the field must be populated. Field presence can be + // described as "serialized in the wire format," which follows the following rules: + // + // - the following "nullable" fields must be explicitly set to be considered present: + // - singular message fields (may be their empty value) + // - member fields of a oneof (may be their default value) + // - proto3 optional fields (may be their default value) + // - proto2 scalar fields + // - proto3 scalar fields must be non-zero to be considered present + // - repeated and map fields must be non-empty to be considered present + // + // ```proto + // message MyMessage { + // // The field `value` must be set to a non-null value. + // optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; + // } + // ``` bool required = 25; - //`ignore_empty` specifies that the validation rules of this field should be - //evaluated only if the field isn't empty. If the field is empty, no validation - //rules are applied. - // - //```proto - //message MyRepeated { - // // The field `value` validation rules should be evaluated only if the field isn't empty. - // repeated string value = 1 [(buf.validate.field).ignore_empty = true]; - //} - //``` + // If `ignore_empty` is true and applied to a non-nullable field (see + // `required` for more details), validation is skipped on the field if it is + // the default or empty value. Adding `ignore_empty` to a "nullable" field is + // a noop as these unset fields already skip validation (with the exception + // of `required`). + // + // ```proto + // message MyRepeated { + // // The field `value` min_len rule is only applied if the field isn't empty. + // repeated string value = 1 [ + // (buf.validate.field).ignore_empty = true, + // (buf.validate.field).min_len = 5 + // ]; + // } + // ``` bool ignore_empty = 26; oneof type { // Scalar Field Types @@ -196,31 +209,31 @@ message FieldConstraints { // FloatRules describes the constraints applied to `float` values. These // rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type. message FloatRules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MyFloat { + // // value must equal 42.0 // float value = 1 [(buf.validate.field).float.const = 42.0]; - //} - //``` + // } + // ``` optional float const = 1 [(priv.field).cel = { id: "float.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 + // ```proto + // message MyFloat { + // // value must be less than 10.0 // float value = 1 [(buf.validate.field).float.lt = 10.0]; - //} - //``` + // } + // ``` float lt = 2 [(priv.field).cel = { id: "float.lt", expression: @@ -228,16 +241,16 @@ message FloatRules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 + // ```proto + // message MyFloat { + // // value must be less than or equal to 10.0 // float value = 1 [(buf.validate.field).float.lte = 10.0]; - //} - //``` + // } + // ``` float lte = 3 [(priv.field).cel = { id: "float.lte", expression: @@ -247,24 +260,24 @@ message FloatRules { } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` float gt = 4 [ (priv.field).cel = { id: "float.gt", @@ -298,24 +311,24 @@ message FloatRules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` float gte = 5 [ (priv.field).cel = { id: "float.gte", @@ -350,37 +363,37 @@ message FloatRules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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] - // repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; - //} - //``` + // ```proto + // message MyFloat { + // // value must be in list [1.0, 2.0, 3.0] + // repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; + // } + // ``` repeated float in = 6 [(priv.field).cel = { id: "float.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`in` requires the field value to not be equal to any of the specified + // `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] - // repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; - //} - //``` + // ```proto + // message MyFloat { + // // value must not be in list [1.0, 2.0, 3.0] + // repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; + // } + // ``` repeated float not_in = 7 [(priv.field).cel = { id: "float.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", }]; - //`finite` requires the field value to be finite. If the field value is + // `finite` requires the field value to be finite. If the field value is // infinite or NaN, an error message is generated. bool finite = 8 [(priv.field).cel = { id: "float.finite", @@ -391,15 +404,15 @@ message FloatRules { // DoubleRules describes the constraints applied to `double` values. These // rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type. message DoubleRules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MyDouble { + // // value must equal 42.0 // double value = 1 [(buf.validate.field).double.const = 42.0]; - //} - //``` + // } + // ``` optional double const = 1 [(priv.field).cel = { id: "double.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", @@ -409,12 +422,12 @@ message DoubleRules { // 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 + // ```proto + // message MyDouble { + // // value must be less than 10.0 // double value = 1 [(buf.validate.field).double.lt = 10.0]; - //} - //``` + // } + // ``` double lt = 2 [(priv.field).cel = { id: "double.lt", expression: @@ -422,16 +435,16 @@ message DoubleRules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified value + // `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 + // ```proto + // message MyDouble { + // // value must be less than or equal to 10.0 // double value = 1 [(buf.validate.field).double.lte = 10.0]; - //} - //``` + // } + // ``` double lte = 3 [(priv.field).cel = { id: "double.lte", expression: @@ -446,18 +459,18 @@ message DoubleRules { // 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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` double gt = 4 [ (priv.field).cel = { id: "double.gt", @@ -497,18 +510,18 @@ message DoubleRules { // 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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` double gte = 5 [ (priv.field).cel = { id: "double.gte", @@ -546,33 +559,33 @@ message DoubleRules { // 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] - // repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; - //} - //``` + // ```proto + // message MyDouble { + // // value must be in list [1.0, 2.0, 3.0] + // repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; + // } + // ``` repeated double in = 6 [(priv.field).cel = { id: "double.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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] - // repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; - //} - //``` + // ```proto + // message MyDouble { + // // value must not be in list [1.0, 2.0, 3.0] + // repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; + // } + // ``` repeated double not_in = 7 [(priv.field).cel = { id: "double.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", }]; - //`finite` requires the field value to be finite. If the field value is + // `finite` requires the field value to be finite. If the field value is // infinite or NaN, an error message is generated. bool finite = 8 [(priv.field).cel = { id: "double.finite", @@ -583,15 +596,15 @@ message DoubleRules { // Int32Rules describes the constraints applied to `int32` values. These // rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type. message Int32Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MyInt32 { + // // value must equal 42 // int32 value = 1 [(buf.validate.field).int32.const = 42]; - //} - //``` + // } + // ``` optional int32 const = 1 [(priv.field).cel = { id: "int32.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", @@ -601,12 +614,12 @@ message Int32Rules { // < 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 + // ```proto + // message MyInt32 { + // // value must be less than 10 // int32 value = 1 [(buf.validate.field).int32.lt = 10]; - //} - //``` + // } + // ``` int32 lt = 2 [(priv.field).cel = { id: "int32.lt", expression: @@ -614,16 +627,16 @@ message Int32Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 + // ```proto + // message MyInt32 { + // // value must be less than or equal to 10 // int32 value = 1 [(buf.validate.field).int32.lte = 10]; - //} - //``` + // } + // ``` int32 lte = 3 [(priv.field).cel = { id: "int32.lte", expression: @@ -632,24 +645,24 @@ message Int32Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` int32 gt = 4 [ (priv.field).cel = { id: "int32.gt", @@ -683,24 +696,24 @@ message Int32Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified value + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` int32 gte = 5 [ (priv.field).cel = { id: "int32.gte", @@ -735,31 +748,31 @@ message Int32Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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] - // repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyInt32 { + // // value must be in list [1, 2, 3] + // repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; + // } + // ``` repeated int32 in = 6 [(priv.field).cel = { id: "int32.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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] - // repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyInt32 { + // // value must not be in list [1, 2, 3] + // repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; + // } + // ``` repeated int32 not_in = 7 [(priv.field).cel = { id: "int32.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -769,30 +782,30 @@ message Int32Rules { // Int64Rules describes the constraints applied to `int64` values. These // rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type. message Int64Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MyInt64 { + // // value must equal 42 // int64 value = 1 [(buf.validate.field).int64.const = 42]; - //} - //``` + // } + // ``` optional int64 const = 1 [(priv.field).cel = { id: "int64.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 + // ```proto + // message MyInt64 { + // // value must be less than 10 // int64 value = 1 [(buf.validate.field).int64.lt = 10]; - //} - //``` + // } + // ``` int64 lt = 2 [(priv.field).cel = { id: "int64.lt", expression: @@ -800,16 +813,16 @@ message Int64Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 + // ```proto + // message MyInt64 { + // // value must be less than or equal to 10 // int64 value = 1 [(buf.validate.field).int64.lte = 10]; - //} - //``` + // } + // ``` int64 lte = 3 [(priv.field).cel = { id: "int64.lte", expression: @@ -818,24 +831,24 @@ message Int64Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` int64 gt = 4 [ (priv.field).cel = { id: "int64.gt", @@ -869,24 +882,24 @@ message Int64Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` int64 gte = 5 [ (priv.field).cel = { id: "int64.gte", @@ -921,31 +934,31 @@ message Int64Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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] - // repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyInt64 { + // // value must be in list [1, 2, 3] + // repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; + // } + // ``` repeated int64 in = 6 [(priv.field).cel = { id: "int64.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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] - // repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyInt64 { + // // value must not be in list [1, 2, 3] + // repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; + // } + // ``` repeated int64 not_in = 7 [(priv.field).cel = { id: "int64.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -955,30 +968,30 @@ message Int64Rules { // UInt32Rules describes the constraints applied to `uint32` values. These // rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type. message UInt32Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MyUInt32 { + // // value must equal 42 // uint32 value = 1 [(buf.validate.field).uint32.const = 42]; - //} - //``` + // } + // ``` optional uint32 const = 1 [(priv.field).cel = { id: "uint32.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 + // ```proto + // message MyUInt32 { + // // value must be less than 10 // uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; - //} - //``` + // } + // ``` uint32 lt = 2 [(priv.field).cel = { id: "uint32.lt", expression: @@ -986,16 +999,16 @@ message UInt32Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 + // ```proto + // message MyUInt32 { + // // value must be less than or equal to 10 // uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; - //} - //``` + // } + // ``` uint32 lte = 3 [(priv.field).cel = { id: "uint32.lte", expression: @@ -1004,24 +1017,24 @@ message UInt32Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` uint32 gt = 4 [ (priv.field).cel = { id: "uint32.gt", @@ -1055,24 +1068,24 @@ message UInt32Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` uint32 gte = 5 [ (priv.field).cel = { id: "uint32.gte", @@ -1107,31 +1120,31 @@ message UInt32Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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] - // repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyUInt32 { + // // value must be in list [1, 2, 3] + // repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; + // } + // ``` repeated uint32 in = 6 [(priv.field).cel = { id: "uint32.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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] - // repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyUInt32 { + // // value must not be in list [1, 2, 3] + // repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; + // } + // ``` repeated uint32 not_in = 7 [(priv.field).cel = { id: "uint32.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -1141,30 +1154,30 @@ message UInt32Rules { // UInt64Rules describes the constraints applied to `uint64` values. These // rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type. message UInt64Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MyUInt64 { + // // value must equal 42 // uint64 value = 1 [(buf.validate.field).uint64.const = 42]; - //} - //``` + // } + // ``` optional uint64 const = 1 [(priv.field).cel = { id: "uint64.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 + // ```proto + // message MyUInt64 { + // // value must be less than 10 // uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; - //} - //``` + // } + // ``` uint64 lt = 2 [(priv.field).cel = { id: "uint64.lt", expression: @@ -1172,16 +1185,16 @@ message UInt64Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 + // ```proto + // message MyUInt64 { + // // value must be less than or equal to 10 // uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; - //} - //``` + // } + // ``` uint64 lte = 3 [(priv.field).cel = { id: "uint64.lte", expression: @@ -1190,24 +1203,24 @@ message UInt64Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` uint64 gt = 4 [ (priv.field).cel = { id: "uint64.gt", @@ -1241,24 +1254,24 @@ message UInt64Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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]; + // ```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 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 }]; - //} - //``` + // // 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 }]; + // } + // ``` uint64 gte = 5 [ (priv.field).cel = { id: "uint64.gte", @@ -1292,31 +1305,31 @@ message UInt64Rules { } ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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] - // repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyUInt64 { + // // value must be in list [1, 2, 3] + // repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; + // } + // ``` repeated uint64 in = 6 [(priv.field).cel = { id: "uint64.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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] - // repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyUInt64 { + // // value must not be in list [1, 2, 3] + // repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; + // } + // ``` repeated uint64 not_in = 7 [(priv.field).cel = { id: "uint64.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -1325,30 +1338,30 @@ message UInt64Rules { // SInt32Rules describes the constraints applied to `sint32` values. message SInt32Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 + // ```proto + // message MySInt32 { + // // value must equal 42 // sint32 value = 1 [(buf.validate.field).sint32.const = 42]; - //} - //``` + // } + // ``` optional sint32 const = 1 [(priv.field).cel = { id: "sint32.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field + // `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 + // ```proto + // message MySInt32 { + // // value must be less than 10 // sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; - //} - //``` + // } + // ``` sint32 lt = 2 [(priv.field).cel = { id: "sint32.lt", expression: @@ -1356,16 +1369,16 @@ message SInt32Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 + // ```proto + // message MySInt32 { + // // value must be less than or equal to 10 // sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; - //} - //``` + // } + // ``` sint32 lte = 3 [(priv.field).cel = { id: "sint32.lte", expression: @@ -1374,24 +1387,24 @@ message SInt32Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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 MySInt32 { - // // value must be greater than 5 [sint32.gt] - // sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + // ```proto + // message MySInt32 { + // // value must be greater than 5 [sint32.gt] + // sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; // - // // value must be greater than 5 and less than 10 [sint32.gt_lt] - // sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + // // value must be greater than 5 and less than 10 [sint32.gt_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; // - // // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] - // sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; - //} - //``` + // // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + // } + // ``` sint32 gt = 4 [ (priv.field).cel = { id: "sint32.gt", @@ -1425,14 +1438,14 @@ message SInt32Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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 MySInt32 { + // ```proto + // message MySInt32 { // // value must be greater than or equal to 5 [sint32.gte] // sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; // @@ -1441,8 +1454,8 @@ message SInt32Rules { // // // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] // sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; - //} - //``` + // } + // ``` sint32 gte = 5 [ (priv.field).cel = { id: "sint32.gte", @@ -1477,31 +1490,31 @@ message SInt32Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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 MySInt32 { - // // value must be in list [1, 2, 3] - // repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySInt32 { + // // value must be in list [1, 2, 3] + // repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; + // } + // ``` repeated sint32 in = 6 [(priv.field).cel = { id: "sint32.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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 MySInt32 { - // // value must not be in list [1, 2, 3] - // repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySInt32 { + // // value must not be in list [1, 2, 3] + // repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; + // } + // ``` repeated sint32 not_in = 7 [(priv.field).cel = { id: "sint32.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -1510,30 +1523,30 @@ message SInt32Rules { // SInt64Rules describes the constraints applied to `sint64` values. message SInt64Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 MySInt64 { - // // value must equal 42 + // ```proto + // message MySInt64 { + // // value must equal 42 // sint64 value = 1 [(buf.validate.field).sint64.const = 42]; - //} - //``` + // } + // ``` optional sint64 const = 1 [(priv.field).cel = { id: "sint64.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field + // `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 MySInt64 { - // // value must be less than 10 + // ```proto + // message MySInt64 { + // // value must be less than 10 // sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; - //} - //``` + // } + // ``` sint64 lt = 2 [(priv.field).cel = { id: "sint64.lt", expression: @@ -1541,16 +1554,16 @@ message SInt64Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 MySInt64 { - // // value must be less than or equal to 10 + // ```proto + // message MySInt64 { + // // value must be less than or equal to 10 // sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; - //} - //``` + // } + // ``` sint64 lte = 3 [(priv.field).cel = { id: "sint64.lte", expression: @@ -1559,24 +1572,24 @@ message SInt64Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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 MySInt64 { - // // value must be greater than 5 [sint64.gt] - // sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + // ```proto + // message MySInt64 { + // // value must be greater than 5 [sint64.gt] + // sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; // - // // value must be greater than 5 and less than 10 [sint64.gt_lt] - // sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + // // value must be greater than 5 and less than 10 [sint64.gt_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; // - // // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] - // sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; - //} - //``` + // // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + // } + // ``` sint64 gt = 4 [ (priv.field).cel = { id: "sint64.gt", @@ -1610,24 +1623,24 @@ message SInt64Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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 MySInt64 { - // // value must be greater than or equal to 5 [sint64.gte] - // sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + // ```proto + // message MySInt64 { + // // value must be greater than or equal to 5 [sint64.gte] + // sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; // - // // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] - // sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + // // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; // - // // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] - // sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; - //} - //``` + // // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + // } + // ``` sint64 gte = 5 [ (priv.field).cel = { id: "sint64.gte", @@ -1662,31 +1675,31 @@ message SInt64Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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 MySInt64 { - // // value must be in list [1, 2, 3] - // repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySInt64 { + // // value must be in list [1, 2, 3] + // repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; + // } + // ``` repeated sint64 in = 6 [(priv.field).cel = { id: "sint64.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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 MySInt64 { - // // value must not be in list [1, 2, 3] - // repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySInt64 { + // // value must not be in list [1, 2, 3] + // repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; + // } + // ``` repeated sint64 not_in = 7 [(priv.field).cel = { id: "sint64.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -1695,30 +1708,30 @@ message SInt64Rules { // Fixed32Rules describes the constraints applied to `fixed32` values. message Fixed32Rules { - //`const` requires the field value to exactly match the specified value. + // `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 MyFixed32 { - // // value must equal 42 + // ```proto + // message MyFixed32 { + // // value must equal 42 // fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; - //} - //``` + // } + // ``` optional fixed32 const = 1 [(priv.field).cel = { id: "fixed32.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 MyFixed32 { - // // value must be less than 10 + // ```proto + // message MyFixed32 { + // // value must be less than 10 // fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; - //} - //``` + // } + // ``` fixed32 lt = 2 [(priv.field).cel = { id: "fixed32.lt", expression: @@ -1726,16 +1739,16 @@ message Fixed32Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 MyFixed32 { - // // value must be less than or equal to 10 + // ```proto + // message MyFixed32 { + // // value must be less than or equal to 10 // fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; - //} - //``` + // } + // ``` fixed32 lte = 3 [(priv.field).cel = { id: "fixed32.lte", expression: @@ -1744,24 +1757,24 @@ message Fixed32Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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 MyFixed32 { - // // value must be greater than 5 [fixed32.gt] - // fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + // ```proto + // message MyFixed32 { + // // value must be greater than 5 [fixed32.gt] + // fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; // - // // value must be greater than 5 and less than 10 [fixed32.gt_lt] - // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + // // value must be greater than 5 and less than 10 [fixed32.gt_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; // - // // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] - // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; - //} - //``` + // // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + // } + // ``` fixed32 gt = 4 [ (priv.field).cel = { id: "fixed32.gt", @@ -1795,24 +1808,24 @@ message Fixed32Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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 MyFixed32 { - // // value must be greater than or equal to 5 [fixed32.gte] - // fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + // ```proto + // message MyFixed32 { + // // value must be greater than or equal to 5 [fixed32.gte] + // fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; // - // // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] - // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + // // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; // - // // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] - // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; - //} - //``` + // // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + // } + // ``` fixed32 gte = 5 [ (priv.field).cel = { id: "fixed32.gte", @@ -1847,31 +1860,31 @@ message Fixed32Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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 MyFixed32 { - // // value must be in list [1, 2, 3] - // repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyFixed32 { + // // value must be in list [1, 2, 3] + // repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; + // } + // ``` repeated fixed32 in = 6 [(priv.field).cel = { id: "fixed32.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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 MyFixed32 { - // // value must not be in list [1, 2, 3] - // repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyFixed32 { + // // value must not be in list [1, 2, 3] + // repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; + // } + // ``` repeated fixed32 not_in = 7 [(priv.field).cel = { id: "fixed32.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -1880,30 +1893,30 @@ message Fixed32Rules { // Fixed64Rules describes the constraints applied to `fixed64` values. message Fixed64Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 MyFixed64 { - // // value must equal 42 + // ```proto + // message MyFixed64 { + // // value must equal 42 // fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; - //} - //``` + // } + // ``` optional fixed64 const = 1 [(priv.field).cel = { id: "fixed64.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 MyFixed64 { - // // value must be less than 10 + // ```proto + // message MyFixed64 { + // // value must be less than 10 // fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; - //} - //``` + // } + // ``` fixed64 lt = 2 [(priv.field).cel = { id: "fixed64.lt", expression: @@ -1911,17 +1924,17 @@ message Fixed64Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 MyFixed64 { - // // value must be less than or equal to 10 + // ```proto + // message MyFixed64 { + // // value must be less than or equal to 10 // fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; - //} - //``` - fixed64 lte = 3 [(priv.field).cel = { + // } + // ``` + fixed64 lte = 3 [(priv.field).cel = { id: "fixed64.lte", expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -1929,24 +1942,24 @@ message Fixed64Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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 MyFixed64 { - // // value must be greater than 5 [fixed64.gt] - // fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + // ```proto + // message MyFixed64 { + // // value must be greater than 5 [fixed64.gt] + // fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; // - // // value must be greater than 5 and less than 10 [fixed64.gt_lt] - // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + // // value must be greater than 5 and less than 10 [fixed64.gt_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; // - // // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] - // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; - //} - //``` + // // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + // } + // ``` fixed64 gt = 4 [ (priv.field).cel = { id: "fixed64.gt", @@ -1980,24 +1993,24 @@ message Fixed64Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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 MyFixed64 { - // // value must be greater than or equal to 5 [fixed64.gte] - // fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + // ```proto + // message MyFixed64 { + // // value must be greater than or equal to 5 [fixed64.gte] + // fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; // - // // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] - // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + // // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; // - // // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] - // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; - //} - //``` + // // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + // } + // ``` fixed64 gte = 5 [ (priv.field).cel = { id: "fixed64.gte", @@ -2032,31 +2045,31 @@ message Fixed64Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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 MyFixed64 { - // // value must be in list [1, 2, 3] - // repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyFixed64 { + // // value must be in list [1, 2, 3] + // repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; + // } + // ``` repeated fixed64 in = 6 [(priv.field).cel = { id: "fixed64.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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 MyFixed64 { - // // value must not be in list [1, 2, 3] - // repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MyFixed64 { + // // value must not be in list [1, 2, 3] + // repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; + // } + // ``` repeated fixed64 not_in = 7 [(priv.field).cel = { id: "fixed64.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -2065,30 +2078,30 @@ message Fixed64Rules { // SFixed32Rules describes the constraints applied to `fixed32` values. message SFixed32Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 MySFixed32 { - // // value must equal 42 + // ```proto + // message MySFixed32 { + // // value must equal 42 // sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; - //} - //``` + // } + // ``` optional sfixed32 const = 1 [(priv.field).cel = { id: "sfixed32.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 MySFixed32 { - // // value must be less than 10 + // ```proto + // message MySFixed32 { + // // value must be less than 10 // sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; - //} - //``` + // } + // ``` sfixed32 lt = 2 [(priv.field).cel = { id: "sfixed32.lt", expression: @@ -2096,16 +2109,16 @@ message SFixed32Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 MySFixed32 { - // // value must be less than or equal to 10 + // ```proto + // message MySFixed32 { + // // value must be less than or equal to 10 // sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; - //} - //``` + // } + // ``` sfixed32 lte = 3 [(priv.field).cel = { id: "sfixed32.lte", expression: @@ -2114,24 +2127,24 @@ message SFixed32Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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 MySFixed32 { - // // value must be greater than 5 [sfixed32.gt] - // sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + // ```proto + // message MySFixed32 { + // // value must be greater than 5 [sfixed32.gt] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; // - // // value must be greater than 5 and less than 10 [sfixed32.gt_lt] - // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + // // value must be greater than 5 and less than 10 [sfixed32.gt_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; // - // // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] - // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; - //} - //``` + // // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + // } + // ``` sfixed32 gt = 4 [ (priv.field).cel = { id: "sfixed32.gt", @@ -2165,24 +2178,24 @@ message SFixed32Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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 MySFixed32 { - // // value must be greater than or equal to 5 [sfixed32.gte] - // sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + // ```proto + // message MySFixed32 { + // // value must be greater than or equal to 5 [sfixed32.gte] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; // - // // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] - // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + // // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; // - // // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] - // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; - //} - //``` + // // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + // } + // ``` sfixed32 gte = 5 [ (priv.field).cel = { id: "sfixed32.gte", @@ -2217,31 +2230,31 @@ message SFixed32Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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 MySFixed32 { - // // value must be in list [1, 2, 3] - // repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySFixed32 { + // // value must be in list [1, 2, 3] + // repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; + // } + // ``` repeated sfixed32 in = 6 [(priv.field).cel = { id: "sfixed32.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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 MySFixed32 { - // // value must not be in list [1, 2, 3] - // repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySFixed32 { + // // value must not be in list [1, 2, 3] + // repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; + // } + // ``` repeated sfixed32 not_in = 7 [(priv.field).cel = { id: "sfixed32.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -2250,30 +2263,30 @@ message SFixed32Rules { // SFixed64Rules describes the constraints applied to `fixed64` values. message SFixed64Rules { - //`const` requires the field value to exactly match the specified value. If + // `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 MySFixed64 { - // // value must equal 42 + // ```proto + // message MySFixed64 { + // // value must equal 42 // sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; - //} - //``` + // } + // ``` optional sfixed64 const = 1 [(priv.field).cel = { id: "sfixed64.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` requires the field value to be less than the specified value (field < + // `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 MySFixed64 { - // // value must be less than 10 + // ```proto + // message MySFixed64 { + // // value must be less than 10 // sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; - //} - //``` + // } + // ``` sfixed64 lt = 2 [(priv.field).cel = { id: "sfixed64.lt", expression: @@ -2281,16 +2294,16 @@ message SFixed64Rules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` requires the field value to be less than or equal to the specified + // `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 MySFixed64 { - // // value must be less than or equal to 10 + // ```proto + // message MySFixed64 { + // // value must be less than or equal to 10 // sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; - //} - //``` + // } + // ``` sfixed64 lte = 3 [(priv.field).cel = { id: "sfixed64.lte", expression: @@ -2299,24 +2312,24 @@ message SFixed64Rules { }]; } oneof greater_than { - //`gt` requires the field value to be greater than the specified value + // `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 MySFixed64 { - // // value must be greater than 5 [sfixed64.gt] - // sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + // ```proto + // message MySFixed64 { + // // value must be greater than 5 [sfixed64.gt] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; // - // // value must be greater than 5 and less than 10 [sfixed64.gt_lt] - // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + // // value must be greater than 5 and less than 10 [sfixed64.gt_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; // - // // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] - // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; - //} - //``` + // // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + // } + // ``` sfixed64 gt = 4 [ (priv.field).cel = { id: "sfixed64.gt", @@ -2350,24 +2363,24 @@ message SFixed64Rules { } ]; - //`gte` requires the field value to be greater than or equal to the specified + // `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 MySFixed64 { - // // value must be greater than or equal to 5 [sfixed64.gte] - // sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + // ```proto + // message MySFixed64 { + // // value must be greater than or equal to 5 [sfixed64.gte] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; // - // // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] - // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + // // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; // - // // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] - // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; - //} - //``` + // // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + // } + // ``` sfixed64 gte = 5 [ (priv.field).cel = { id: "sfixed64.gte", @@ -2402,31 +2415,31 @@ message SFixed64Rules { ]; } - //`in` requires the field value to be equal to one of the specified values. + // `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 MySFixed64 { - // // value must be in list [1, 2, 3] - // repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySFixed64 { + // // value must be in list [1, 2, 3] + // repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; + // } + // ``` repeated sfixed64 in = 6 [(priv.field).cel = { id: "sfixed64.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to not be equal to any of the specified + // `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 MySFixed64 { - // // value must not be in list [1, 2, 3] - // repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; - //} - //``` + // ```proto + // message MySFixed64 { + // // value must not be in list [1, 2, 3] + // repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; + // } + // ``` repeated sfixed64 not_in = 7 [(priv.field).cel = { id: "sfixed64.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -2436,15 +2449,15 @@ message SFixed64Rules { // BoolRules describes the constraints applied to `bool` values. These rules // may also be applied to the `google.protobuf.BoolValue` Well-Known-Type. message BoolRules { - //`const` requires the field value to exactly match the specified boolean value. - //If the field value doesn't match, an error message is generated. + // `const` requires the field value to exactly match the specified boolean value. + // If the field value doesn't match, an error message is generated. // - //```proto - //message MyBool { - // // value must equal true + // ```proto + // message MyBool { + // // value must equal true // bool value = 1 [(buf.validate.field).bool.const = true]; - //} - //``` + // } + // ``` optional bool const = 1 [(priv.field).cel = { id: "bool.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", @@ -2454,215 +2467,215 @@ message BoolRules { // StringRules describes the constraints applied to `string` values These // rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type. message StringRules { - //`const` requires the field value to exactly match the specified value. If - //the field value doesn't match, an error message is generated. + // `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 MyString { - // // value must equal `hello` + // ```proto + // message MyString { + // // value must equal `hello` // string value = 1 [(buf.validate.field).string.const = "hello"]; - //} - //``` + // } + // ``` optional string const = 1 [(priv.field).cel = { id: "string.const", expression: "this != rules.const ? 'value must equal `%s`'.format([rules.const]) : ''" }]; - //`len` dictates that the field value must have the specified - //number of characters (Unicode code points), which may differ from the number - //of bytes in the string. If the field value does not meet the specified - //length, an error message will be generated. + // `len` dictates that the field value must have the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value does not meet the specified + // length, an error message will be generated. // - //```proto - //message MyString { - // // value length must be 5 characters + // ```proto + // message MyString { + // // value length must be 5 characters // string value = 1 [(buf.validate.field).string.len = 5]; - //} - //``` + // } + // ``` optional uint64 len = 19 [(priv.field).cel = { id: "string.len", expression: "uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''" }]; - //`min_len` specifies that the field value must have at least the specified - //number of characters (Unicode code points), which may differ from the number - //of bytes in the string. If the field value contains fewer characters, an error - //message will be generated. + // `min_len` specifies that the field value must have at least the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value contains fewer characters, an error + // message will be generated. // - //```proto - //message MyString { - // // value length must be at least 3 characters + // ```proto + // message MyString { + // // value length must be at least 3 characters // string value = 1 [(buf.validate.field).string.min_len = 3]; - //} - //``` + // } + // ``` optional uint64 min_len = 2 [(priv.field).cel = { id: "string.min_len", expression: "uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''" }]; - //`max_len` specifies that the field value must have no more than the specified - //number of characters (Unicode code points), which may differ from the - //number of bytes in the string. If the field value contains more characters, - //an error message will be generated. + // `max_len` specifies that the field value must have no more than the specified + // number of characters (Unicode code points), which may differ from the + // number of bytes in the string. If the field value contains more characters, + // an error message will be generated. // - //```proto - //message MyString { - // // value length must be at most 10 characters + // ```proto + // message MyString { + // // value length must be at most 10 characters // string value = 1 [(buf.validate.field).string.max_len = 10]; - //} - //``` + // } + // ``` optional uint64 max_len = 3 [(priv.field).cel = { id: "string.max_len", expression: "uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''" }]; - //`len_bytes` dictates that the field value must have the specified number of - //bytes. If the field value does not match the specified length in bytes, - //an error message will be generated. + // `len_bytes` dictates that the field value must have the specified number of + // bytes. If the field value does not match the specified length in bytes, + // an error message will be generated. // - //```proto - //message MyString { - // // value length must be 6 bytes + // ```proto + // message MyString { + // // value length must be 6 bytes // string value = 1 [(buf.validate.field).string.len_bytes = 6]; - //} - //``` + // } + // ``` optional uint64 len_bytes = 20 [(priv.field).cel = { id: "string.len_bytes", expression: "uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''" }]; - //`min_bytes` specifies that the field value must have at least the specified - //number of bytes. If the field value contains fewer bytes, an error message - //will be generated. + // `min_bytes` specifies that the field value must have at least the specified + // number of bytes. If the field value contains fewer bytes, an error message + // will be generated. // - //```proto - //message MyString { - // // value length must be at least 4 bytes + // ```proto + // message MyString { + // // value length must be at least 4 bytes // string value = 1 [(buf.validate.field).string.min_bytes = 4]; - //} + // } // - //``` + // ``` optional uint64 min_bytes = 4 [(priv.field).cel = { id: "string.min_bytes", expression: "uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''" }]; - //`max_bytes` specifies that the field value must have no more than the + // `max_bytes` specifies that the field value must have no more than the //specified number of bytes. If the field value contains more bytes, an - //error message will be generated. + // error message will be generated. // - //```proto - //message MyString { - // // value length must be at most 8 bytes + // ```proto + // message MyString { + // // value length must be at most 8 bytes // string value = 1 [(buf.validate.field).string.max_bytes = 8]; - //} - //``` + // } + // ``` optional uint64 max_bytes = 5 [(priv.field).cel = { id: "string.max_bytes", expression: "uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''", }]; - //`pattern` specifies that the field value must match the specified - //regular expression (RE2 syntax), with the expression provided without any - //delimiters. If the field value doesn't match the regular expression, an - //error message will be generated. + // `pattern` specifies that the field value must match the specified + // regular expression (RE2 syntax), with the expression provided without any + // delimiters. If the field value doesn't match the regular expression, an + // error message will be generated. // - //```proto - //message MyString { - // // value does not match regex pattern `^[a-zA-Z]//$` + // ```proto + // message MyString { + // // value does not match regex pattern `^[a-zA-Z]//$` // string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; - //} - //``` + // } + // ``` optional string pattern = 6 [(priv.field).cel = { id: "string.pattern", expression: "!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''" }]; - //`prefix` specifies that the field value must have the + // `prefix` specifies that the field value must have the //specified substring at the beginning of the string. If the field value - //doesn't start with the specified prefix, an error message will be - //generated. + // doesn't start with the specified prefix, an error message will be + // generated. // - //```proto - //message MyString { - // // value does not have prefix `pre` + // ```proto + // message MyString { + // // value does not have prefix `pre` // string value = 1 [(buf.validate.field).string.prefix = "pre"]; - //} - //``` + // } + // ``` optional string prefix = 7 [(priv.field).cel = { id: "string.prefix", expression: "!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''" }]; - //`suffix` specifies that the field value must have the + // `suffix` specifies that the field value must have the //specified substring at the end of the string. If the field value doesn't - //end with the specified suffix, an error message will be generated. + // end with the specified suffix, an error message will be generated. // - //```proto - //message MyString { - // // value does not have suffix `post` + // ```proto + // message MyString { + // // value does not have suffix `post` // string value = 1 [(buf.validate.field).string.suffix = "post"]; - //} - //``` + // } + // ``` optional string suffix = 8 [(priv.field).cel = { id: "string.suffix", expression: "!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''" }]; - //`contains` specifies that the field value must have the + // `contains` specifies that the field value must have the //specified substring anywhere in the string. If the field value doesn't - //contain the specified substring, an error message will be generated. + // contain the specified substring, an error message will be generated. // - //```proto - //message MyString { - // // value does not contain substring `inside`. + // ```proto + // message MyString { + // // value does not contain substring `inside`. // string value = 1 [(buf.validate.field).string.contains = "inside"]; - //} - //``` + // } + // ``` optional string contains = 9 [(priv.field).cel = { id: "string.contains", expression: "!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''" }]; - //`not_contains` specifies that the field value must not have the + // `not_contains` specifies that the field value must not have the //specified substring anywhere in the string. If the field value contains - //the specified substring, an error message will be generated. + // the specified substring, an error message will be generated. // - //```proto - //message MyString { - // // value contains substring `inside`. + // ```proto + // message MyString { + // // value contains substring `inside`. // string value = 1 [(buf.validate.field).string.not_contains = "inside"]; - //} - //``` + // } + // ``` optional string not_contains = 23 [(priv.field).cel = { id: "string.not_contains", expression: "this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''" }]; - //`in` specifies that the field value must be equal to one of the specified - //values. If the field value isn't one of the specified values, an error - //message will be generated. + // `in` specifies that the field value must be equal to one of the specified + // values. If the field value isn't one of the specified values, an error + // message will be generated. // - //```proto - //message MyString { - // // value must be in list ["apple", "banana"] - // repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; - //} - //``` + // ```proto + // message MyString { + // // value must be in list ["apple", "banana"] + // repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + // } + // ``` repeated string in = 10 [(priv.field).cel = { id: "string.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; - //`not_in` specifies that the field value cannot be equal to any - //of the specified values. If the field value is one of the specified values, - //an error message will be generated. - //```proto - //message MyString { - // // value must not be in list ["orange", "grape"] - // repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; - //} - //``` + // `not_in` specifies that the field value cannot be equal to any + // of the specified values. If the field value is one of the specified values, + // an error message will be generated. + // ```proto + // message MyString { + // // value must not be in list ["orange", "grape"] + // repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + // } + // ``` repeated string not_in = 11 [(priv.field).cel = { id: "string.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" @@ -2671,173 +2684,275 @@ message StringRules { // `WellKnown` rules provide advanced constraints against common string // patterns oneof well_known { - //`email` specifies that the field value must be a valid email address - //(addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). - //If the field value isn't a valid email address, an error message will be generated. + // `email` specifies that the field value must be a valid email address + // (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). + // If the field value isn't a valid email address, an error message will be generated. // - //```proto - //message MyString { - // // value must be a valid email address + // ```proto + // message MyString { + // // value must be a valid email address // string value = 1 [(buf.validate.field).string.email = true]; - //} - //``` + // } + // ``` bool email = 12 [(priv.field).cel = { id: "string.email", message: "value must be a valid email address", expression: "this.isEmail()" }]; - //`hostname` specifies that the field value must be a valid - //hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support - //internationalized domain names (IDNs). If the field value isn't a - //valid hostname, an error message will be generated. + // `hostname` specifies that the field value must be a valid + // hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support + // internationalized domain names (IDNs). If the field value isn't a + // valid hostname, an error message will be generated. // - //```proto - //message MyString { - // // value must be a valid hostname + // ```proto + // message MyString { + // // value must be a valid hostname // string value = 1 [(buf.validate.field).string.hostname = true]; - //} - //``` + // } + // ``` bool hostname = 13 [(priv.field).cel = { id: "string.hostname", message: "value must be a valid hostname", expression: "this.isHostname()", }]; - //`ip` specifies that the field value must be a valid IP - //(v4 or v6) address, without surrounding square brackets for IPv6 addresses. - //If the field value isn't a valid IP address, an error message will be - //generated. + // `ip` specifies that the field value must be a valid IP + // (v4 or v6) address, without surrounding square brackets for IPv6 addresses. + // If the field value isn't a valid IP address, an error message will be + // generated. // - //```proto - //message MyString { - // // value must be a valid IP address + // ```proto + // message MyString { + // // value must be a valid IP address // string value = 1 [(buf.validate.field).string.ip = true]; - //} - //``` + // } + // ``` bool ip = 14 [(priv.field).cel = { id: "string.ip", message: "value must be a valid IP address", expression: "this.isIp()", }]; - //`ipv4` specifies that the field value must be a valid IPv4 - //address. If the field value isn't a valid IPv4 address, an error message - //will be generated. + // `ipv4` specifies that the field value must be a valid IPv4 + // address. If the field value isn't a valid IPv4 address, an error message + // will be generated. // - //```proto - //message MyString { - // // value must be a valid IPv4 address + // ```proto + // message MyString { + // // value must be a valid IPv4 address // string value = 1 [(buf.validate.field).string.ipv4 = true]; - //} - //``` + // } + // ``` bool ipv4 = 15 [(priv.field).cel = { id: "string.ipv4", message: "value must be a valid IPv4 address", expression: "this.isIp(4)" }]; - //`ipv6` specifies that the field value must be a valid - //IPv6 address, without surrounding square brackets. If the field value is - //not a valid IPv6 address, an error message will be generated. + // `ipv6` specifies that the field value must be a valid + // IPv6 address, without surrounding square brackets. If the field value is + // not a valid IPv6 address, an error message will be generated. // - //```proto - //message MyString { - // // value must be a valid IPv6 address + // ```proto + // message MyString { + // // value must be a valid IPv6 address // string value = 1 [(buf.validate.field).string.ipv6 = true]; - //} - //``` + // } + // ``` bool ipv6 = 16 [(priv.field).cel = { id: "string.ipv6", message: "value must be a valid IPv6 address", expression: "this.isIp(6)", }]; - //`uri` specifies that the field value must be a valid, - //absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, - //absolute URI, an error message will be generated. + // `uri` specifies that the field value must be a valid, + // absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, + // absolute URI, an error message will be generated. // - //```proto - //message MyString { - // // value must be a valid URI + // ```proto + // message MyString { + // // value must be a valid URI // string value = 1 [(buf.validate.field).string.uri = true]; - //} - //``` + // } + // ``` bool uri = 17 [(priv.field).cel = { id: "string.uri", message: "value must be a valid URI", expression: "this.isUri()", }]; - //`uri_ref` specifies that the field value must be a valid URI - //as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the - //field value isn't a valid URI, an error message will be generated. + // `uri_ref` specifies that the field value must be a valid URI + // as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the + // field value isn't a valid URI, an error message will be generated. // - //```proto - //message MyString { - // // value must be a valid URI + // ```proto + // message MyString { + // // value must be a valid URI // string value = 1 [(buf.validate.field).string.uri_ref = true]; - //} - //``` + // } + // ``` bool uri_ref = 18 [(priv.field).cel = { id: "string.uri_ref", message: "value must be a valid URI", expression: "this.isUriRef()", }]; - //`address` specifies that the field value must be either a valid hostname - //as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) - //(which doesn't support internationalized domain names or IDNs) or a valid - //IP (v4 or v6). If the field value isn't a valid hostname or IP, an error - //message will be generated. + // `address` specifies that the field value must be either a valid hostname + // as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) + // (which doesn't support internationalized domain names or IDNs) or a valid + // IP (v4 or v6). If the field value isn't a valid hostname or IP, an error + // message will be generated. // - //```proto - //message MyString { - // // value must be a valid hostname, or ip address + // ```proto + // message MyString { + // // value must be a valid hostname, or ip address // string value = 1 [(buf.validate.field).string.address = true]; - //} - //``` + // } + // ``` bool address = 21 [(priv.field).cel = { id: "string.address", message: "value must be a valid hostname, or ip address", expression: "this.isHostname() || this.isIp()", }]; - //`uuid` specifies that the field value must be a valid UUID as defined by - //[RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the - //field value isn't a valid UUID, an error message will be generated. + // `uuid` specifies that the field value must be a valid UUID as defined by + // [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the + // field value isn't a valid UUID, an error message will be generated. // - //```proto - //message MyString { - // // value must be a valid UUID + // ```proto + // message MyString { + // // value must be a valid UUID // string value = 1 [(buf.validate.field).string.uuid = true]; - //} - //``` + // } + // ``` bool uuid = 22 [(priv.field).cel = { id: "string.uuid", expression: "!this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$') ? 'value must be a valid UUID' : ''" }]; - //`well_known_regex` specifies a common well-known pattern - //defined as a regex. If the field value doesn't match the well-known - //regex, an error message will be generated. + // `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) + // address with prefix length. If the field value isn't a valid IP with prefix + // length, an error message will be generated. + // + // + // ```proto + // message MyString { + // // value must be a valid IP with prefix length + // string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + // } + // ``` + bool ip_with_prefixlen = 26 [(priv.field).cel = { + id: "string.ip_with_prefixlen", + message: "value must be a valid IP prefix", + expression: "this.isIpPrefix()", + }]; + + // `ipv4_with_prefixlen` specifies that the field value must be a valid + // IPv4 address with prefix. + // If the field value isn't a valid IPv4 address with prefix length, + // an error message will be generated. + // + // ```proto + // message MyString { + // // value must be a valid IPv4 address with prefix lentgh + // string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + // } + // ``` + bool ipv4_with_prefixlen = 27 [(priv.field).cel = { + id: "string.ipv4_with_prefixlen", + message: "value must be a valid IPv4 address with prefix length", + expression: "this.isIpPrefix(4)" + }]; + + // `ipv6_with_prefixlen` specifies that the field value must be a valid + // IPv6 address with prefix length. + // If the field value is not a valid IPv6 address with prefix length, + // an error message will be generated. + // + // ```proto + // message MyString { + // // value must be a valid IPv6 address prefix length + // string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + // } + // ``` + bool ipv6_with_prefixlen = 28 [(priv.field).cel = { + id: "string.ipv6_with_prefixlen", + message: "value must be a valid IPv6 address with prefix length", + expression: "this.isIpPrefix(6)", + }]; + + // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. + // If the field value isn't a valid IP prefix, an error message will be + // generated. The prefix must have all zeros for the masked bits of the prefix (e.g., + // `127.0.0.0/16`, not `127.0.0.1/16`). + // + // ```proto + // message MyString { + // // value must be a valid IP prefix + // string value = 1 [(buf.validate.field).string.ip_prefix = true]; + // } + // ``` + bool ip_prefix = 29 [(priv.field).cel = { + id: "string.ip_prefix", + message: "value must be a valid IP prefix", + expression: "this.isIpPrefix(true)", + }]; + + // `ipv4_prefix` specifies that the field value must be a valid IPv4 + // prefix. If the field value isn't a valid IPv4 prefix, an error message + // will be generated. The prefix must have all zeros for the masked bits of + // the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). // - //```proto - //message MyString { - // // value must be a valid HTTP header value + // ```proto + // message MyString { + // // value must be a valid IPv4 prefix + // string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + // } + // ``` + bool ipv4_prefix = 30 [(priv.field).cel = { + id: "string.ipv4_prefix", + message: "value must be a valid IPv4 prefix", + expression: "this.isIpPrefix(4, true)" + }]; + + // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. + // If the field value is not a valid IPv6 prefix, an error message will be + // generated. The prefix must have all zeros for the masked bits of the prefix + // (e.g., `2001:db8::/48`, not `2001:db8::1/48`). + // + // ```proto + // message MyString { + // // value must be a valid IPv6 prefix + // string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + // } + // ``` + bool ipv6_prefix = 31 [(priv.field).cel = { + id: "string.ipv6_prefix", + message: "value must be a valid IPv6 prefix", + expression: "this.isIpPrefix(6, true)", + }]; + + // `well_known_regex` specifies a common well-known pattern + // defined as a regex. If the field value doesn't match the well-known + // regex, an error message will be generated. + // + // ```proto + // message MyString { + // // value must be a valid HTTP header value // string value = 1 [(buf.validate.field).string.well_known_regex = 2]; - //} - //``` + // } + // ``` // - //#### KnownRegex + // #### KnownRegex // - //`well_known_regex` contains some well-known patterns. + // `well_known_regex` contains some well-known patterns. // - //| Name | Number | Description | - //|-------------------------------|--------|-------------------------------------------| - //| KNOWN_REGEX_UNSPECIFIED | 0 | | - //| KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | - //| KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | + // | Name | Number | Description | + // |-------------------------------|--------|-------------------------------------------| + // | KNOWN_REGEX_UNSPECIFIED | 0 | | + // | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | + // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | KnownRegex well_known_regex = 24 [ (priv.field).cel = { id: "string.well_known_regex.header_name" @@ -2856,18 +2971,18 @@ message StringRules { ]; } - //This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to - //enable strict header validation. By default, this is true, and HTTP header - //validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser - //validations that only disallow `\r\n\0` characters, which can be used to - //bypass header matching rules. + // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + // enable strict header validation. By default, this is true, and HTTP header + // validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser + // validations that only disallow `\r\n\0` characters, which can be used to + // bypass header matching rules. // - //```proto - //message MyString { + // ```proto + // message MyString { // // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. // string value = 1 [(buf.validate.field).string.strict = false]; - //} - //``` + // } + // ``` optional bool strict = 25; } @@ -2885,152 +3000,152 @@ enum KnownRegex { // BytesRules describe the constraints applied to `bytes` values. These rules // may also be applied to the `google.protobuf.BytesValue` Well-Known-Type. message BytesRules { - //`const` requires the field value to exactly match the specified bytes - //value. If the field value doesn't match, an error message is generated. + // `const` requires the field value to exactly match the specified bytes + // value. If the field value doesn't match, an error message is generated. // - //```proto - //message MyBytes { - // // value must be "\x01\x02\x03\x04" + // ```proto + // message MyBytes { + // // value must be "\x01\x02\x03\x04" // bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; - //} - //``` + // } + // ``` optional bytes const = 1 [(priv.field).cel = { id: "bytes.const", expression: "this != rules.const ? 'value must be %x'.format([rules.const]) : ''" }]; - //`len` requires the field value to have the specified length in bytes. - //If the field value doesn't match, an error message is generated. + // `len` requires the field value to have the specified length in bytes. + // If the field value doesn't match, an error message is generated. // - //```proto - //message MyBytes { - // // value length must be 4 bytes. - // optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; - //} - //``` + // ```proto + // message MyBytes { + // // value length must be 4 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + // } + // ``` optional uint64 len = 13 [(priv.field).cel = { id: "bytes.len", expression: "uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''" }]; - //`min_len` requires the field value to have at least the specified minimum - //length in bytes. - //If the field value doesn't meet the requirement, an error message is generated. + // `min_len` requires the field value to have at least the specified minimum + // length in bytes. + // If the field value doesn't meet the requirement, an error message is generated. // - //```proto - //message MyBytes { - // // value length must be at least 2 bytes. - // optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; - //} - //``` + // ```proto + // message MyBytes { + // // value length must be at least 2 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + // } + // ``` optional uint64 min_len = 2 [(priv.field).cel = { id: "bytes.min_len", expression: "uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''" }]; - //`max_len` requires the field value to have at most the specified maximum - //length in bytes. - //If the field value exceeds the requirement, an error message is generated. + // `max_len` requires the field value to have at most the specified maximum + // length in bytes. + // If the field value exceeds the requirement, an error message is generated. // - //```proto - //message MyBytes { - // // value must be at most 6 bytes. - // optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; - //} - //``` + // ```proto + // message MyBytes { + // // value must be at most 6 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + // } + // ``` optional uint64 max_len = 3 [(priv.field).cel = { id: "bytes.max_len", expression: "uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''" }]; - //`pattern` requires the field value to match the specified regular - //expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). - //The value of the field must be valid UTF-8 or validation will fail with a - //runtime error. - //If the field value doesn't match the pattern, an error message is generated. + // `pattern` requires the field value to match the specified regular + // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + // The value of the field must be valid UTF-8 or validation will fail with a + // runtime error. + // If the field value doesn't match the pattern, an error message is generated. // - //```proto - //message MyBytes { - // // value must match regex pattern "^[a-zA-Z0-9]+$". - // optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; - //} - //``` + // ```proto + // message MyBytes { + // // value must match regex pattern "^[a-zA-Z0-9]+$". + // optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + // } + // ``` optional string pattern = 4 [(priv.field).cel = { id: "bytes.pattern", expression: "!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''" }]; - //`prefix` requires the field value to have the specified bytes at the - //beginning of the string. - //If the field value doesn't meet the requirement, an error message is generated. + // `prefix` requires the field value to have the specified bytes at the + // beginning of the string. + // If the field value doesn't meet the requirement, an error message is generated. // - //```proto - //message MyBytes { - //// value does not have prefix \x01\x02 - //optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; - //} - //``` + // ```proto + // message MyBytes { + // // value does not have prefix \x01\x02 + // optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + // } + // ``` optional bytes prefix = 5 [(priv.field).cel = { id: "bytes.prefix", expression: "!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''" }]; - //`suffix` requires the field value to have the specified bytes at the end - //of the string. - //If the field value doesn't meet the requirement, an error message is generated. + // `suffix` requires the field value to have the specified bytes at the end + // of the string. + // If the field value doesn't meet the requirement, an error message is generated. // - //```proto - //message MyBytes { - // // value does not have suffix \x03\x04 - // optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; - //} - //``` + // ```proto + // message MyBytes { + // // value does not have suffix \x03\x04 + // optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + // } + // ``` optional bytes suffix = 6 [(priv.field).cel = { id: "bytes.suffix", expression: "!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''" }]; - //`contains` requires the field value to have the specified bytes anywhere in - //the string. - //If the field value doesn't meet the requirement, an error message is generated. + // `contains` requires the field value to have the specified bytes anywhere in + // the string. + // If the field value doesn't meet the requirement, an error message is generated. // - //```protobuf - //message MyBytes { - // // value does not contain \x02\x03 - // optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; - //} - //``` + // ```protobuf + // message MyBytes { + // // value does not contain \x02\x03 + // optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + // } + // ``` optional bytes contains = 7 [(priv.field).cel = { id: "bytes.contains", expression: "!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''" }]; - //`in` requires the field value to be equal to one of the specified - //values. If the field value doesn't match any of the specified values, an - //error message is generated. + // `in` requires the field value to be equal to one of the specified + // values. If the field value doesn't match any of the specified values, an + // error message is generated. // - //```protobuf - //message MyBytes { - // // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] - // optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - //} - //``` + // ```protobuf + // message MyBytes { + // // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // ``` repeated bytes in = 8 [(priv.field).cel = { id: "bytes.in", expression: "dyn(rules)['in'].size() > 0 && !(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; - //`not_in` requires the field value to be not equal to any of the specified - //values. - //If the field value matches any of the specified values, an error message is - //generated. + // `not_in` requires the field value to be not equal to any of the specified + // values. + // If the field value matches any of the specified values, an error message is + // generated. // - //```proto - //message MyBytes { - // // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] - // optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - //} - //``` + // ```proto + // message MyBytes { + // // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // ``` repeated bytes not_in = 9 [(priv.field).cel = { id: "bytes.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" @@ -3039,42 +3154,42 @@ message BytesRules { // WellKnown rules provide advanced constraints against common byte // patterns oneof well_known { - //`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. - //If the field value doesn't meet this constraint, an error message is generated. - // - //```proto - //message MyBytes { - // // value must be a valid IP address - // optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; - //} - //``` + // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + // If the field value doesn't meet this constraint, an error message is generated. + // + // ```proto + // message MyBytes { + // // value must be a valid IP address + // optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + // } + // ``` bool ip = 10 [(priv.field).cel = { id: "bytes.ip", expression: "this.size() != 4 && this.size() != 16 ? 'value must be a valid IP address' : ''" }]; - //`ipv4` ensures that the field `value` is a valid IPv4 address in byte format. - //If the field value doesn't meet this constraint, an error message is generated. + // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + // If the field value doesn't meet this constraint, an error message is generated. // - //```proto - //message MyBytes { - // // value must be a valid IPv4 address - // optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; - //} - //``` + // ```proto + // message MyBytes { + // // value must be a valid IPv4 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + // } + // ``` bool ipv4 = 11 [(priv.field).cel = { id: "bytes.ipv4", expression: "this.size() != 4 ? 'value must be a valid IPv4 address' : ''" }]; - //`ipv6` ensures that the field `value` is a valid IPv6 address in byte format. - //If the field value doesn't meet this constraint, an error message is generated. - //```proto - //message MyBytes { - // // value must be a valid IPv6 address - // optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; - //} - //``` + // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + // If the field value doesn't meet this constraint, an error message is generated. + // ```proto + // message MyBytes { + // // value must be a valid IPv6 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + // } + // ``` bool ipv6 = 12 [(priv.field).cel = { id: "bytes.ipv6", expression: "this.size() != 16 ? 'value must be a valid IPv6 address' : ''" @@ -3084,80 +3199,80 @@ message BytesRules { // EnumRules describe the constraints applied to `enum` values. message EnumRules { - //`const` requires the field value to exactly match the specified enum value. - //If the field value doesn't match, an error message is generated. - // - //```proto - //enum MyEnum { - // MY_ENUM_UNSPECIFIED = 0; - // MY_ENUM_VALUE1 = 1; - // MY_ENUM_VALUE2 = 2; - //} - // - //message MyMessage { - // // The field `value` must be exactly MY_ENUM_VALUE1. + // `const` requires the field value to exactly match the specified enum value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be exactly MY_ENUM_VALUE1. // MyEnum value = 1 [(buf.validate.field).enum.const = 1]; - //} - //``` + // } + // ``` optional int32 const = 1 [(priv.field).cel = { id: "enum.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; - //`defined_only` requires the field value to be one of the defined values for + // `defined_only` requires the field value to be one of the defined values for // this enum, failing on any undefined value. // - //```proto - //enum MyEnum { - // MY_ENUM_UNSPECIFIED = 0; - // MY_ENUM_VALUE1 = 1; - // MY_ENUM_VALUE2 = 2; - //} + // ```proto + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } // - //message MyMessage { - // // The field `value` must be a defined value of MyEnum. + // message MyMessage { + // // The field `value` must be a defined value of MyEnum. // MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; - //} - //``` + // } + // ``` optional bool defined_only = 2; - //`in` requires the field value to be equal to one of the + // `in` requires the field value to be equal to one of the //specified enum values. If the field value doesn't match any of the //specified values, an error message is generated. // - //```proto - //enum MyEnum { - // MY_ENUM_UNSPECIFIED = 0; - // MY_ENUM_VALUE1 = 1; - // MY_ENUM_VALUE2 = 2; - //} - // - //message MyMessage { - // // The field `value` must be equal to one of the specified values. - // MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; - //} - //``` + // ```proto + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be equal to one of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + // } + // ``` repeated int32 in = 3 [(priv.field).cel = { id: "enum.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` requires the field value to be not equal to any of the + // `not_in` requires the field value to be not equal to any of the //specified enum values. If the field value matches one of the specified - //values, an error message is generated. - // - //```proto - //enum MyEnum { - // MY_ENUM_UNSPECIFIED = 0; - // MY_ENUM_VALUE1 = 1; - // MY_ENUM_VALUE2 = 2; - //} - // - //message MyMessage { - // // The field `value` must not be equal to any of the specified values. - // MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; - //} - //``` + // values, an error message is generated. + // + // ```proto + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must not be equal to any of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + // } + // ``` repeated int32 not_in = 4 [(priv.field).cel = { id: "enum.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -3166,95 +3281,97 @@ message EnumRules { // RepeatedRules describe the constraints applied to `repeated` values. message RepeatedRules { - //`min_items` requires that this field must contain at least the specified - //minimum number of items. - // - //```proto - //message MyRepeated { - // // value must contain at least 2 items - // repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; - //} - //``` + // `min_items` requires that this field must contain at least the specified + // minimum number of items. + // + // Note that `min_items = 1` is equivalent to setting a field as `required`. + // + // ```proto + // message MyRepeated { + // // value must contain at least 2 items + // repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + // } + // ``` optional uint64 min_items = 1 [(priv.field).cel = { id: "repeated.min_items" expression: "uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''" }]; - //`max_items` denotes that this field must not exceed a - //certain number of items as the upper limit. If the field contains more - //items than specified, an error message will be generated, requiring the - //field to maintain no more than the specified number of items. + // `max_items` denotes that this field must not exceed a + // certain number of items as the upper limit. If the field contains more + // items than specified, an error message will be generated, requiring the + // field to maintain no more than the specified number of items. // - //```proto - //message MyRepeated { - // // value must contain no more than 3 item(s) - // repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; - //} - //``` + // ```proto + // message MyRepeated { + // // value must contain no more than 3 item(s) + // repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + // } + // ``` optional uint64 max_items = 2 [(priv.field).cel = { id: "repeated.max_items" expression: "uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''" }]; - //`unique` indicates that all elements in this field must - //be unique. This constraint is strictly applicable to scalar and enum - //types, with message types not being supported. + // `unique` indicates that all elements in this field must + // be unique. This constraint is strictly applicable to scalar and enum + // types, with message types not being supported. // - //```proto - //message MyRepeated { - // // repeated value must contain unique items - // repeated string value = 1 [(buf.validate.field).repeated.unique = true]; - //} - //``` + // ```proto + // message MyRepeated { + // // repeated value must contain unique items + // repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + // } + // ``` optional bool unique = 3 [(priv.field).cel = { id: "repeated.unique" message: "repeated value must contain unique items" expression: "this.unique()" }]; - //`items` details the constraints to be applied to each item - //in the field. Even for repeated message fields, validation is executed - //against each item unless skip is explicitly specified. - // - //```proto - //message MyRepeated { - // // The items in the field `value` must follow the specified constraints. - // repeated string value = 1 [(buf.validate.field).repeated.items = { - // string: { - // min_len: 3 - // max_len: 10 - // } - // }]; - //} - //``` + // `items` details the constraints to be applied to each item + // in the field. Even for repeated message fields, validation is executed + // against each item unless skip is explicitly specified. + // + // ```proto + // message MyRepeated { + // // The items in the field `value` must follow the specified constraints. + // repeated string value = 1 [(buf.validate.field).repeated.items = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // ``` optional FieldConstraints items = 4; } // MapRules describe the constraints applied to `map` values. message MapRules { //Specifies the minimum number of key-value pairs allowed. If the field has - //fewer key-value pairs than specified, an error message is generated. - // - //```proto - //message MyMap { - // // The field `value` must have at least 2 key-value pairs. - // map value = 1 [(buf.validate.field).map.min_pairs = 2]; - //} - //``` + // fewer key-value pairs than specified, an error message is generated. + // + // ```proto + // message MyMap { + // // The field `value` must have at least 2 key-value pairs. + // map value = 1 [(buf.validate.field).map.min_pairs = 2]; + // } + // ``` optional uint64 min_pairs = 1 [(priv.field).cel = { id: "map.min_pairs" expression: "uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''" }]; //Specifies the maximum number of key-value pairs allowed. If the field has - //more key-value pairs than specified, an error message is generated. - // - //```proto - //message MyMap { - // // The field `value` must have at most 3 key-value pairs. - // map value = 1 [(buf.validate.field).map.max_pairs = 3]; - //} - //``` + // more key-value pairs than specified, an error message is generated. + // + // ```proto + // message MyMap { + // // The field `value` must have at most 3 key-value pairs. + // map value = 1 [(buf.validate.field).map.max_pairs = 3]; + // } + // ``` optional uint64 max_pairs = 2 [(priv.field).cel = { id: "map.max_pairs" expression: "uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''" @@ -3262,89 +3379,89 @@ message MapRules { //Specifies the constraints to be applied to each key in the field. // - //```proto - //message MyMap { - // // The keys in the field `value` must follow the specified constraints. - // map value = 1 [(buf.validate.field).map.keys = { - // string: { - // min_len: 3 - // max_len: 10 - // } - // }]; - //} - //``` + // ```proto + // message MyMap { + // // The keys in the field `value` must follow the specified constraints. + // map value = 1 [(buf.validate.field).map.keys = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // ``` optional FieldConstraints keys = 4; //Specifies the constraints to be applied to the value of each key in the - //field. Message values will still have their validations evaluated unless + // field. Message values will still have their validations evaluated unless //skip is specified here. // - //```proto - //message MyMap { - // // The values in the field `value` must follow the specified constraints. - // map value = 1 [(buf.validate.field).map.values = { - // string: { - // min_len: 5 - // max_len: 20 - // } - // }]; - //} - //``` + // ```proto + // message MyMap { + // // The values in the field `value` must follow the specified constraints. + // map value = 1 [(buf.validate.field).map.values = { + // string: { + // min_len: 5 + // max_len: 20 + // } + // }]; + // } + // ``` optional FieldConstraints values = 5; } // AnyRules describe constraints applied exclusively to the `google.protobuf.Any` well-known type. message AnyRules { - //`in` requires the field's `type_url` to be equal to one of the + // `in` requires the field's `type_url` to be equal to one of the //specified values. If it doesn't match any of the specified values, an error - //message is generated. + // message is generated. // - //```proto - //message MyAny { - // // The `value` field must have a `type_url` equal to one of the specified values. + // ```proto + // message MyAny { + // // The `value` field must have a `type_url` equal to one of the specified values. // google.protobuf.Any value = 1 [(buf.validate.field).any.in = ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]]; - //} - //``` + // } + // ``` repeated string in = 2; // 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. // - //```proto - //message MyAny { - // // The field `value` must not have a `type_url` equal to any of the specified values. + // ```proto + // message MyAny { + // // The field `value` must not have a `type_url` equal to any of the specified values. // google.protobuf.Any value = 1 [(buf.validate.field).any.not_in = ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]]; - //} - //``` + // } + // ``` repeated string not_in = 3; } // DurationRules describe the constraints applied exclusively to the `google.protobuf.Duration` well-known type. message DurationRules { - //`const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. - //If the field's value deviates from the specified value, an error message - //will be generated. + // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. // - //```proto - //message MyDuration { - // // value must equal 5s + // ```proto + // message MyDuration { + // // value must equal 5s // google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; - //} - //``` + // } + // ``` optional google.protobuf.Duration const = 2 [(priv.field).cel = { id: "duration.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", }]; oneof less_than { - //`lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, - //exclusive. If the field's value is greater than or equal to the specified - //value, an error message will be generated. + // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + // exclusive. If the field's value is greater than or equal to the specified + // value, an error message will be generated. // - //```proto - //message MyDuration { - // // value must be less than 5s + // ```proto + // message MyDuration { + // // value must be less than 5s // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; - //} - //``` + // } + // ``` google.protobuf.Duration lt = 3 [(priv.field).cel = { id: "duration.lt", expression: @@ -3352,16 +3469,16 @@ message DurationRules { "? 'value must be less than %s'.format([rules.lt]) : ''" }]; - //`lte` indicates that the field must be less than or equal to the specified - //value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, - //an error message will be generated. + // `lte` indicates that the field must be less than or equal to the specified + // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + // an error message will be generated. // - //```proto - //message MyDuration { - // // value must be less than or equal to 10s + // ```proto + // message MyDuration { + // // value must be less than or equal to 10s // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; - //} - //``` + // } + // ``` google.protobuf.Duration lte = 4 [(priv.field).cel = { id: "duration.lte", expression: @@ -3376,18 +3493,18 @@ message DurationRules { // specified range. If the field value doesn't meet the required conditions, // an error message is generated. // - //```proto - //message MyDuration { - // // duration must be greater than 5s [duration.gt] - // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + // ```proto + // message MyDuration { + // // duration must be greater than 5s [duration.gt] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; // - // // duration must be greater than 5s and less than 10s [duration.gt_lt] - // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + // // duration must be greater than 5s and less than 10s [duration.gt_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; // - // // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] - // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; - //} - //``` + // // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // ``` google.protobuf.Duration gt = 5 [ (priv.field).cel = { id: "duration.gt", @@ -3427,8 +3544,8 @@ message DurationRules { // be outside the specified range. If the field value doesn't meet the // required conditions, an error message is generated. // - //```proto - //message MyDuration { + // ```proto + // message MyDuration { // // duration must be greater than or equal to 5s [duration.gte] // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; // @@ -3437,8 +3554,8 @@ message DurationRules { // // // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; - //} - //``` + // } + // ``` google.protobuf.Duration gte = 6 [ (priv.field).cel = { id: "duration.gte", @@ -3473,32 +3590,32 @@ message DurationRules { ]; } - //`in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. - //If the field's value doesn't correspond to any of the specified values, - //an error message will be generated. + // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + // If the field's value doesn't correspond to any of the specified values, + // an error message will be generated. // - //```proto - //message MyDuration { - // // value must be in list [1s, 2s, 3s] + // ```proto + // message MyDuration { + // // value must be in list [1s, 2s, 3s] // google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; - //} - //``` + // } + // ``` repeated google.protobuf.Duration in = 7 [(priv.field).cel = { id: "duration.in", expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''", }]; - //`not_in` denotes that the field must not be equal to - //any of the specified values of the `google.protobuf.Duration` type. - //If the field's value matches any of these values, an error message will be - //generated. + // `not_in` denotes that the field must not be equal to + // any of the specified values of the `google.protobuf.Duration` type. + // If the field's value matches any of these values, an error message will be + // generated. // - //```proto - //message MyDuration { - // // value must not be in list [1s, 2s, 3s] + // ```proto + // message MyDuration { + // // value must not be in list [1s, 2s, 3s] // google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; - //} - //``` + // } + // ``` repeated google.protobuf.Duration not_in = 8 [(priv.field).cel = { id: "duration.not_in", expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''", @@ -3507,14 +3624,14 @@ message DurationRules { // TimestampRules describe the constraints applied exclusively to the `google.protobuf.Timestamp` well-known type. message TimestampRules { - //`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. + // `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. // - //```proto - //message MyTimestamp { - // // value must equal 2023-05-03T10:00:00Z + // ```proto + // message MyTimestamp { + // // value must equal 2023-05-03T10:00:00Z // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; - //} - //``` + // } + // ``` optional google.protobuf.Timestamp const = 2 [(priv.field).cel = { id: "timestamp.const", expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''", @@ -3550,38 +3667,38 @@ message TimestampRules { "? 'value must be less than or equal to %s'.format([rules.lte]) : ''" }]; - //`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. + // `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. // - //```proto - //message MyTimestamp { + // ```proto + // message MyTimestamp { // // value must be less than now // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; - //} - //``` + // } + // ``` bool lt_now = 7 [(priv.field).cel = { id: "timestamp.lt_now", expression: "this > now ? 'value must be less than now' : ''" }]; } oneof greater_than { - //`gt` requires the timestamp field value to be greater than the specified + // `gt` requires the timestamp 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 MyTimestamp { - // // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] - // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + // ```proto + // message MyTimestamp { + // // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; // - // // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] - // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; // - // // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] - // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - //} - //``` + // // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // ``` google.protobuf.Timestamp gt = 5 [ (priv.field).cel = { id: "timestamp.gt", @@ -3615,24 +3732,24 @@ message TimestampRules { } ]; - //`gte` requires the timestamp field value to be greater than or equal to the + // `gte` requires the timestamp 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 MyTimestamp { - // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] - // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + // ```proto + // message MyTimestamp { + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; // - // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] - // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; // - // // 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] - // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - //} - //``` + // // 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] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // ``` google.protobuf.Timestamp gte = 6 [ (priv.field).cel = { id: "timestamp.gte", @@ -3666,14 +3783,14 @@ message TimestampRules { } ]; - //`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. + // `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. // - //```proto - //message MyTimestamp { - // // value must be greater than now + // ```proto + // message MyTimestamp { + // // value must be greater than now // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; - //} - //``` + // } + // ``` bool gt_now = 8 [(priv.field).cel = { id: "timestamp.gt_now", expression: "this < now ? 'value must be greater than now' : ''" @@ -3682,12 +3799,12 @@ message TimestampRules { // `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. // - //```proto - //message MyTimestamp { - // // value must be within 1 hour of now + // ```proto + // message MyTimestamp { + // // value must be within 1 hour of now // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; - //} - //``` + // } + // ``` optional google.protobuf.Duration within = 9 [(priv.field).cel = { id: "timestamp.within", expression: "this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''" diff --git a/protos/cerbos/audit/v1/audit.proto b/protos/cerbos/audit/v1/audit.proto index 5493362..1927598 100644 --- a/protos/cerbos/audit/v1/audit.proto +++ b/protos/cerbos/audit/v1/audit.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/effect/v1/effect.proto b/protos/cerbos/effect/v1/effect.proto index 00fd3ce..97c37a8 100644 --- a/protos/cerbos/effect/v1/effect.proto +++ b/protos/cerbos/effect/v1/effect.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/engine/v1/engine.proto b/protos/cerbos/engine/v1/engine.proto index 120d6e7..022b818 100644 --- a/protos/cerbos/engine/v1/engine.proto +++ b/protos/cerbos/engine/v1/engine.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/policy/v1/policy.proto b/protos/cerbos/policy/v1/policy.proto index 99e7657..46a999b 100644 --- a/protos/cerbos/policy/v1/policy.proto +++ b/protos/cerbos/policy/v1/policy.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/request/v1/request.proto b/protos/cerbos/request/v1/request.proto index ca726af..e567594 100644 --- a/protos/cerbos/request/v1/request.proto +++ b/protos/cerbos/request/v1/request.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/response/v1/response.proto b/protos/cerbos/response/v1/response.proto index 918f2e2..9c236f6 100644 --- a/protos/cerbos/response/v1/response.proto +++ b/protos/cerbos/response/v1/response.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; @@ -60,6 +60,8 @@ message PlanResourcesResponse { Meta meta = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional metadata about the request evaluation process"}]; repeated cerbos.schema.v1.ValidationError validation_errors = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "List of validation errors (if schema validation is enabled)"}]; + + string cerbos_call_id = 8 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Audit log call ID associated with this request"}]; } // Deprecated. See CheckResourcesResponse. @@ -231,6 +233,7 @@ message CheckResourcesResponse { description: "Result for each resource" example: "[{\"resource\": {\"Id\":\"XX125\", \"kind\":\"album:object\"}, \"actions\":{\"view\":\"EFFECT_ALLOW\",\"comment\":\"EFFECT_DENY\"}}]" }]; + string cerbos_call_id = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Audit log call ID associated with this request"}]; } message PlaygroundFailure { diff --git a/protos/cerbos/schema/v1/schema.proto b/protos/cerbos/schema/v1/schema.proto index c6ded0e..853a002 100644 --- a/protos/cerbos/schema/v1/schema.proto +++ b/protos/cerbos/schema/v1/schema.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/svc/v1/svc.proto b/protos/cerbos/svc/v1/svc.proto index 918f478..6269932 100644 --- a/protos/cerbos/svc/v1/svc.proto +++ b/protos/cerbos/svc/v1/svc.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/protos/cerbos/telemetry/v1/telemetry.proto b/protos/cerbos/telemetry/v1/telemetry.proto index e971e21..2854ac9 100644 --- a/protos/cerbos/telemetry/v1/telemetry.proto +++ b/protos/cerbos/telemetry/v1/telemetry.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; diff --git a/src/Buf/Validate/AnyRules.php b/src/Buf/Validate/AnyRules.php index 27d5a47..519aac5 100644 --- a/src/Buf/Validate/AnyRules.php +++ b/src/Buf/Validate/AnyRules.php @@ -16,27 +16,27 @@ class AnyRules extends \Google\Protobuf\Internal\Message { /** - *`in` requires the field's `type_url` to be equal to one of the + * `in` requires the field's `type_url` to be equal to one of the *specified values. If it doesn't match any of the specified values, an error - *message is generated. - *```proto - *message MyAny { - * // The `value` field must have a `type_url` equal to one of the specified values. + * message is generated. + * ```proto + * message MyAny { + * // The `value` field must have a `type_url` equal to one of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.in = ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated string in = 2 [json_name = "in"]; */ private $in; /** * 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. - *```proto - *message MyAny { - * // The field `value` must not have a `type_url` equal to any of the specified values. + * ```proto + * message MyAny { + * // The field `value` must not have a `type_url` equal to any of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.not_in = ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated string not_in = 3 [json_name = "notIn"]; */ @@ -49,23 +49,23 @@ class AnyRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field's `type_url` to be equal to one of the + * `in` requires the field's `type_url` to be equal to one of the * specified values. If it doesn't match any of the specified values, an error - * message is generated. - * ```proto - * message MyAny { - * // The `value` field must have a `type_url` equal to one of the specified values. + * message is generated. + * ```proto + * message MyAny { + * // The `value` field must have a `type_url` equal to one of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.in = ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]]; - * } - * ``` + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in * 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. - * ```proto - * message MyAny { - * // The field `value` must not have a `type_url` equal to any of the specified values. + * ```proto + * message MyAny { + * // The field `value` must not have a `type_url` equal to any of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.not_in = ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]]; - * } - * ``` + * } + * ``` * } */ public function __construct($data = NULL) { @@ -74,15 +74,15 @@ public function __construct($data = NULL) { } /** - *`in` requires the field's `type_url` to be equal to one of the + * `in` requires the field's `type_url` to be equal to one of the *specified values. If it doesn't match any of the specified values, an error - *message is generated. - *```proto - *message MyAny { - * // The `value` field must have a `type_url` equal to one of the specified values. + * message is generated. + * ```proto + * message MyAny { + * // The `value` field must have a `type_url` equal to one of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.in = ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated string in = 2 [json_name = "in"]; * @return \Google\Protobuf\Internal\RepeatedField @@ -93,15 +93,15 @@ public function getIn() } /** - *`in` requires the field's `type_url` to be equal to one of the + * `in` requires the field's `type_url` to be equal to one of the *specified values. If it doesn't match any of the specified values, an error - *message is generated. - *```proto - *message MyAny { - * // The `value` field must have a `type_url` equal to one of the specified values. + * message is generated. + * ```proto + * message MyAny { + * // The `value` field must have a `type_url` equal to one of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.in = ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated string in = 2 [json_name = "in"]; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -117,12 +117,12 @@ public function setIn($var) /** * 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. - *```proto - *message MyAny { - * // The field `value` must not have a `type_url` equal to any of the specified values. + * ```proto + * message MyAny { + * // The field `value` must not have a `type_url` equal to any of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.not_in = ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated string not_in = 3 [json_name = "notIn"]; * @return \Google\Protobuf\Internal\RepeatedField @@ -134,12 +134,12 @@ public function getNotIn() /** * 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. - *```proto - *message MyAny { - * // The field `value` must not have a `type_url` equal to any of the specified values. + * ```proto + * message MyAny { + * // The field `value` must not have a `type_url` equal to any of the specified values. * google.protobuf.Any value = 1 [(buf.validate.field).any.not_in = ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated string not_in = 3 [json_name = "notIn"]; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/BoolRules.php b/src/Buf/Validate/BoolRules.php index 2e85a74..265b004 100644 --- a/src/Buf/Validate/BoolRules.php +++ b/src/Buf/Validate/BoolRules.php @@ -17,14 +17,14 @@ class BoolRules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified boolean value. - *If the field value doesn't match, an error message is generated. - *```proto - *message MyBool { - * // value must equal true + * `const` requires the field value to exactly match the specified boolean value. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBool { + * // value must equal true * bool value = 1 [(buf.validate.field).bool.const = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ @@ -37,14 +37,14 @@ class BoolRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type bool $const - * `const` requires the field value to exactly match the specified boolean value. - * If the field value doesn't match, an error message is generated. - * ```proto - * message MyBool { - * // value must equal true + * `const` requires the field value to exactly match the specified boolean value. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBool { + * // value must equal true * bool value = 1 [(buf.validate.field).bool.const = true]; - * } - * ``` + * } + * ``` * } */ public function __construct($data = NULL) { @@ -53,14 +53,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified boolean value. - *If the field value doesn't match, an error message is generated. - *```proto - *message MyBool { - * // value must equal true + * `const` requires the field value to exactly match the specified boolean value. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBool { + * // value must equal true * bool value = 1 [(buf.validate.field).bool.const = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return bool @@ -81,14 +81,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified boolean value. - *If the field value doesn't match, an error message is generated. - *```proto - *message MyBool { - * // value must equal true + * `const` requires the field value to exactly match the specified boolean value. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBool { + * // value must equal true * bool value = 1 [(buf.validate.field).bool.const = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param bool $var diff --git a/src/Buf/Validate/BytesRules.php b/src/Buf/Validate/BytesRules.php index 8b0be33..dc4e9d1 100644 --- a/src/Buf/Validate/BytesRules.php +++ b/src/Buf/Validate/BytesRules.php @@ -17,142 +17,142 @@ class BytesRules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified bytes - *value. If the field value doesn't match, an error message is generated. - *```proto - *message MyBytes { - * // value must be "\x01\x02\x03\x04" + * `const` requires the field value to exactly match the specified bytes + * value. If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value must be "\x01\x02\x03\x04" * bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`len` requires the field value to have the specified length in bytes. - *If the field value doesn't match, an error message is generated. - *```proto - *message MyBytes { - * // value length must be 4 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; - *} - *``` + * `len` requires the field value to have the specified length in bytes. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be 4 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + * } + * ``` * * Generated from protobuf field optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { */ protected $len = null; /** - *`min_len` requires the field value to have at least the specified minimum - *length in bytes. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value length must be at least 2 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; - *} - *``` + * `min_len` requires the field value to have at least the specified minimum + * length in bytes. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be at least 2 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { */ protected $min_len = null; /** - *`max_len` requires the field value to have at most the specified maximum - *length in bytes. - *If the field value exceeds the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value must be at most 6 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; - *} - *``` + * `max_len` requires the field value to have at most the specified maximum + * length in bytes. + * If the field value exceeds the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value must be at most 6 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + * } + * ``` * * Generated from protobuf field optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { */ protected $max_len = null; /** - *`pattern` requires the field value to match the specified regular - *expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). - *The value of the field must be valid UTF-8 or validation will fail with a - *runtime error. - *If the field value doesn't match the pattern, an error message is generated. - *```proto - *message MyBytes { - * // value must match regex pattern "^[a-zA-Z0-9]+$". - * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; - *} - *``` + * `pattern` requires the field value to match the specified regular + * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + * The value of the field must be valid UTF-8 or validation will fail with a + * runtime error. + * If the field value doesn't match the pattern, an error message is generated. + * ```proto + * message MyBytes { + * // value must match regex pattern "^[a-zA-Z0-9]+$". + * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + * } + * ``` * * Generated from protobuf field optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { */ protected $pattern = null; /** - *`prefix` requires the field value to have the specified bytes at the - *beginning of the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value does not have prefix \x01\x02 - *optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; - *} - *``` + * `prefix` requires the field value to have the specified bytes at the + * beginning of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have prefix \x01\x02 + * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + * } + * ``` * * Generated from protobuf field optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { */ protected $prefix = null; /** - *`suffix` requires the field value to have the specified bytes at the end - *of the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value does not have suffix \x03\x04 - * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; - *} - *``` + * `suffix` requires the field value to have the specified bytes at the end + * of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have suffix \x03\x04 + * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + * } + * ``` * * Generated from protobuf field optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { */ protected $suffix = null; /** - *`contains` requires the field value to have the specified bytes anywhere in - *the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```protobuf - *message MyBytes { - * // value does not contain \x02\x03 - * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; - *} - *``` + * `contains` requires the field value to have the specified bytes anywhere in + * the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```protobuf + * message MyBytes { + * // value does not contain \x02\x03 + * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + * } + * ``` * * Generated from protobuf field optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { */ protected $contains = null; /** - *`in` requires the field value to be equal to one of the specified - *values. If the field value doesn't match any of the specified values, an - *error message is generated. - *```protobuf - *message MyBytes { - * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - *} - *``` + * `in` requires the field value to be equal to one of the specified + * values. If the field value doesn't match any of the specified values, an + * error message is generated. + * ```protobuf + * message MyBytes { + * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * * Generated from protobuf field repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to be not equal to any of the specified - *values. - *If the field value matches any of the specified values, an error message is - *generated. - *```proto - *message MyBytes { - * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - *} - *``` + * `not_in` requires the field value to be not equal to any of the specified + * values. + * If the field value matches any of the specified values, an error message is + * generated. + * ```proto + * message MyBytes { + * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * * Generated from protobuf field repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -166,133 +166,133 @@ class BytesRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $const - * `const` requires the field value to exactly match the specified bytes - * value. If the field value doesn't match, an error message is generated. - * ```proto - * message MyBytes { - * // value must be "\x01\x02\x03\x04" + * `const` requires the field value to exactly match the specified bytes + * value. If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value must be "\x01\x02\x03\x04" * bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; - * } - * ``` + * } + * ``` * @type int|string $len - * `len` requires the field value to have the specified length in bytes. - * If the field value doesn't match, an error message is generated. - * ```proto - * message MyBytes { - * // value length must be 4 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; - * } - * ``` + * `len` requires the field value to have the specified length in bytes. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be 4 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + * } + * ``` * @type int|string $min_len - * `min_len` requires the field value to have at least the specified minimum - * length in bytes. - * If the field value doesn't meet the requirement, an error message is generated. - * ```proto - * message MyBytes { - * // value length must be at least 2 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; - * } - * ``` + * `min_len` requires the field value to have at least the specified minimum + * length in bytes. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be at least 2 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + * } + * ``` * @type int|string $max_len - * `max_len` requires the field value to have at most the specified maximum - * length in bytes. - * If the field value exceeds the requirement, an error message is generated. - * ```proto - * message MyBytes { - * // value must be at most 6 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; - * } - * ``` + * `max_len` requires the field value to have at most the specified maximum + * length in bytes. + * If the field value exceeds the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value must be at most 6 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + * } + * ``` * @type string $pattern - * `pattern` requires the field value to match the specified regular - * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). - * The value of the field must be valid UTF-8 or validation will fail with a - * runtime error. - * If the field value doesn't match the pattern, an error message is generated. - * ```proto - * message MyBytes { - * // value must match regex pattern "^[a-zA-Z0-9]+$". - * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; - * } - * ``` + * `pattern` requires the field value to match the specified regular + * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + * The value of the field must be valid UTF-8 or validation will fail with a + * runtime error. + * If the field value doesn't match the pattern, an error message is generated. + * ```proto + * message MyBytes { + * // value must match regex pattern "^[a-zA-Z0-9]+$". + * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + * } + * ``` * @type string $prefix - * `prefix` requires the field value to have the specified bytes at the - * beginning of the string. - * If the field value doesn't meet the requirement, an error message is generated. - * ```proto - * message MyBytes { - * // value does not have prefix \x01\x02 - * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; - * } - * ``` + * `prefix` requires the field value to have the specified bytes at the + * beginning of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have prefix \x01\x02 + * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + * } + * ``` * @type string $suffix - * `suffix` requires the field value to have the specified bytes at the end - * of the string. - * If the field value doesn't meet the requirement, an error message is generated. - * ```proto - * message MyBytes { - * // value does not have suffix \x03\x04 - * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; - * } - * ``` + * `suffix` requires the field value to have the specified bytes at the end + * of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have suffix \x03\x04 + * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + * } + * ``` * @type string $contains - * `contains` requires the field value to have the specified bytes anywhere in - * the string. - * If the field value doesn't meet the requirement, an error message is generated. - * ```protobuf - * message MyBytes { - * // value does not contain \x02\x03 - * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; - * } - * ``` + * `contains` requires the field value to have the specified bytes anywhere in + * the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```protobuf + * message MyBytes { + * // value does not contain \x02\x03 + * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified - * values. If the field value doesn't match any of the specified values, an - * error message is generated. - * ```protobuf - * message MyBytes { - * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - * } - * ``` + * `in` requires the field value to be equal to one of the specified + * values. If the field value doesn't match any of the specified values, an + * error message is generated. + * ```protobuf + * message MyBytes { + * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to be not equal to any of the specified - * values. - * If the field value matches any of the specified values, an error message is - * generated. - * ```proto - * message MyBytes { - * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - * } - * ``` + * `not_in` requires the field value to be not equal to any of the specified + * values. + * If the field value matches any of the specified values, an error message is + * generated. + * ```proto + * message MyBytes { + * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * @type bool $ip - * `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. - * If the field value doesn't meet this constraint, an error message is generated. - * ```proto - * message MyBytes { - * // value must be a valid IP address - * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; - * } - * ``` + * `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IP address + * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + * } + * ``` * @type bool $ipv4 - * `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. - * If the field value doesn't meet this constraint, an error message is generated. - * ```proto - * message MyBytes { - * // value must be a valid IPv4 address - * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; - * } - * ``` + * `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IPv4 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + * } + * ``` * @type bool $ipv6 - * `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. - * If the field value doesn't meet this constraint, an error message is generated. - * ```proto - * message MyBytes { - * // value must be a valid IPv6 address - * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; - * } - * ``` + * `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IPv6 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -301,14 +301,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified bytes - *value. If the field value doesn't match, an error message is generated. - *```proto - *message MyBytes { - * // value must be "\x01\x02\x03\x04" + * `const` requires the field value to exactly match the specified bytes + * value. If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value must be "\x01\x02\x03\x04" * bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return string @@ -329,14 +329,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified bytes - *value. If the field value doesn't match, an error message is generated. - *```proto - *message MyBytes { - * // value must be "\x01\x02\x03\x04" + * `const` requires the field value to exactly match the specified bytes + * value. If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value must be "\x01\x02\x03\x04" * bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param string $var @@ -351,14 +351,14 @@ public function setConst($var) } /** - *`len` requires the field value to have the specified length in bytes. - *If the field value doesn't match, an error message is generated. - *```proto - *message MyBytes { - * // value length must be 4 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; - *} - *``` + * `len` requires the field value to have the specified length in bytes. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be 4 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + * } + * ``` * * Generated from protobuf field optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { * @return int|string @@ -379,14 +379,14 @@ public function clearLen() } /** - *`len` requires the field value to have the specified length in bytes. - *If the field value doesn't match, an error message is generated. - *```proto - *message MyBytes { - * // value length must be 4 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; - *} - *``` + * `len` requires the field value to have the specified length in bytes. + * If the field value doesn't match, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be 4 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + * } + * ``` * * Generated from protobuf field optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { * @param int|string $var @@ -401,15 +401,15 @@ public function setLen($var) } /** - *`min_len` requires the field value to have at least the specified minimum - *length in bytes. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value length must be at least 2 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; - *} - *``` + * `min_len` requires the field value to have at least the specified minimum + * length in bytes. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be at least 2 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { * @return int|string @@ -430,15 +430,15 @@ public function clearMinLen() } /** - *`min_len` requires the field value to have at least the specified minimum - *length in bytes. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value length must be at least 2 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; - *} - *``` + * `min_len` requires the field value to have at least the specified minimum + * length in bytes. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value length must be at least 2 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { * @param int|string $var @@ -453,15 +453,15 @@ public function setMinLen($var) } /** - *`max_len` requires the field value to have at most the specified maximum - *length in bytes. - *If the field value exceeds the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value must be at most 6 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; - *} - *``` + * `max_len` requires the field value to have at most the specified maximum + * length in bytes. + * If the field value exceeds the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value must be at most 6 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + * } + * ``` * * Generated from protobuf field optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { * @return int|string @@ -482,15 +482,15 @@ public function clearMaxLen() } /** - *`max_len` requires the field value to have at most the specified maximum - *length in bytes. - *If the field value exceeds the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value must be at most 6 bytes. - * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; - *} - *``` + * `max_len` requires the field value to have at most the specified maximum + * length in bytes. + * If the field value exceeds the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value must be at most 6 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + * } + * ``` * * Generated from protobuf field optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { * @param int|string $var @@ -505,17 +505,17 @@ public function setMaxLen($var) } /** - *`pattern` requires the field value to match the specified regular - *expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). - *The value of the field must be valid UTF-8 or validation will fail with a - *runtime error. - *If the field value doesn't match the pattern, an error message is generated. - *```proto - *message MyBytes { - * // value must match regex pattern "^[a-zA-Z0-9]+$". - * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; - *} - *``` + * `pattern` requires the field value to match the specified regular + * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + * The value of the field must be valid UTF-8 or validation will fail with a + * runtime error. + * If the field value doesn't match the pattern, an error message is generated. + * ```proto + * message MyBytes { + * // value must match regex pattern "^[a-zA-Z0-9]+$". + * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + * } + * ``` * * Generated from protobuf field optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { * @return string @@ -536,17 +536,17 @@ public function clearPattern() } /** - *`pattern` requires the field value to match the specified regular - *expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). - *The value of the field must be valid UTF-8 or validation will fail with a - *runtime error. - *If the field value doesn't match the pattern, an error message is generated. - *```proto - *message MyBytes { - * // value must match regex pattern "^[a-zA-Z0-9]+$". - * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; - *} - *``` + * `pattern` requires the field value to match the specified regular + * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + * The value of the field must be valid UTF-8 or validation will fail with a + * runtime error. + * If the field value doesn't match the pattern, an error message is generated. + * ```proto + * message MyBytes { + * // value must match regex pattern "^[a-zA-Z0-9]+$". + * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + * } + * ``` * * Generated from protobuf field optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { * @param string $var @@ -561,15 +561,15 @@ public function setPattern($var) } /** - *`prefix` requires the field value to have the specified bytes at the - *beginning of the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value does not have prefix \x01\x02 - *optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; - *} - *``` + * `prefix` requires the field value to have the specified bytes at the + * beginning of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have prefix \x01\x02 + * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + * } + * ``` * * Generated from protobuf field optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { * @return string @@ -590,15 +590,15 @@ public function clearPrefix() } /** - *`prefix` requires the field value to have the specified bytes at the - *beginning of the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value does not have prefix \x01\x02 - *optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; - *} - *``` + * `prefix` requires the field value to have the specified bytes at the + * beginning of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have prefix \x01\x02 + * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + * } + * ``` * * Generated from protobuf field optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { * @param string $var @@ -613,15 +613,15 @@ public function setPrefix($var) } /** - *`suffix` requires the field value to have the specified bytes at the end - *of the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value does not have suffix \x03\x04 - * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; - *} - *``` + * `suffix` requires the field value to have the specified bytes at the end + * of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have suffix \x03\x04 + * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + * } + * ``` * * Generated from protobuf field optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { * @return string @@ -642,15 +642,15 @@ public function clearSuffix() } /** - *`suffix` requires the field value to have the specified bytes at the end - *of the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```proto - *message MyBytes { - * // value does not have suffix \x03\x04 - * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; - *} - *``` + * `suffix` requires the field value to have the specified bytes at the end + * of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```proto + * message MyBytes { + * // value does not have suffix \x03\x04 + * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + * } + * ``` * * Generated from protobuf field optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { * @param string $var @@ -665,15 +665,15 @@ public function setSuffix($var) } /** - *`contains` requires the field value to have the specified bytes anywhere in - *the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```protobuf - *message MyBytes { - * // value does not contain \x02\x03 - * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; - *} - *``` + * `contains` requires the field value to have the specified bytes anywhere in + * the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```protobuf + * message MyBytes { + * // value does not contain \x02\x03 + * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + * } + * ``` * * Generated from protobuf field optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { * @return string @@ -694,15 +694,15 @@ public function clearContains() } /** - *`contains` requires the field value to have the specified bytes anywhere in - *the string. - *If the field value doesn't meet the requirement, an error message is generated. - *```protobuf - *message MyBytes { - * // value does not contain \x02\x03 - * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; - *} - *``` + * `contains` requires the field value to have the specified bytes anywhere in + * the string. + * If the field value doesn't meet the requirement, an error message is generated. + * ```protobuf + * message MyBytes { + * // value does not contain \x02\x03 + * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + * } + * ``` * * Generated from protobuf field optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { * @param string $var @@ -717,15 +717,15 @@ public function setContains($var) } /** - *`in` requires the field value to be equal to one of the specified - *values. If the field value doesn't match any of the specified values, an - *error message is generated. - *```protobuf - *message MyBytes { - * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - *} - *``` + * `in` requires the field value to be equal to one of the specified + * values. If the field value doesn't match any of the specified values, an + * error message is generated. + * ```protobuf + * message MyBytes { + * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * * Generated from protobuf field repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -736,15 +736,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified - *values. If the field value doesn't match any of the specified values, an - *error message is generated. - *```protobuf - *message MyBytes { - * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - *} - *``` + * `in` requires the field value to be equal to one of the specified + * values. If the field value doesn't match any of the specified values, an + * error message is generated. + * ```protobuf + * message MyBytes { + * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * * Generated from protobuf field repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -759,16 +759,16 @@ public function setIn($var) } /** - *`not_in` requires the field value to be not equal to any of the specified - *values. - *If the field value matches any of the specified values, an error message is - *generated. - *```proto - *message MyBytes { - * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - *} - *``` + * `not_in` requires the field value to be not equal to any of the specified + * values. + * If the field value matches any of the specified values, an error message is + * generated. + * ```proto + * message MyBytes { + * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * * Generated from protobuf field repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -779,16 +779,16 @@ public function getNotIn() } /** - *`not_in` requires the field value to be not equal to any of the specified - *values. - *If the field value matches any of the specified values, an error message is - *generated. - *```proto - *message MyBytes { - * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; - *} - *``` + * `not_in` requires the field value to be not equal to any of the specified + * values. + * If the field value matches any of the specified values, an error message is + * generated. + * ```proto + * message MyBytes { + * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` * * Generated from protobuf field repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -803,14 +803,14 @@ public function setNotIn($var) } /** - *`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. - *If the field value doesn't meet this constraint, an error message is generated. - *```proto - *message MyBytes { - * // value must be a valid IP address - * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; - *} - *``` + * `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IP address + * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + * } + * ``` * * Generated from protobuf field bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { * @return bool @@ -826,14 +826,14 @@ public function hasIp() } /** - *`ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. - *If the field value doesn't meet this constraint, an error message is generated. - *```proto - *message MyBytes { - * // value must be a valid IP address - * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; - *} - *``` + * `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IP address + * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + * } + * ``` * * Generated from protobuf field bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { * @param bool $var @@ -848,14 +848,14 @@ public function setIp($var) } /** - *`ipv4` ensures that the field `value` is a valid IPv4 address in byte format. - *If the field value doesn't meet this constraint, an error message is generated. - *```proto - *message MyBytes { - * // value must be a valid IPv4 address - * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; - *} - *``` + * `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IPv4 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + * } + * ``` * * Generated from protobuf field bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { * @return bool @@ -871,14 +871,14 @@ public function hasIpv4() } /** - *`ipv4` ensures that the field `value` is a valid IPv4 address in byte format. - *If the field value doesn't meet this constraint, an error message is generated. - *```proto - *message MyBytes { - * // value must be a valid IPv4 address - * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; - *} - *``` + * `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IPv4 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + * } + * ``` * * Generated from protobuf field bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { * @param bool $var @@ -893,14 +893,14 @@ public function setIpv4($var) } /** - *`ipv6` ensures that the field `value` is a valid IPv6 address in byte format. - *If the field value doesn't meet this constraint, an error message is generated. - *```proto - *message MyBytes { - * // value must be a valid IPv6 address - * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; - *} - *``` + * `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IPv6 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + * } + * ``` * * Generated from protobuf field bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { * @return bool @@ -916,14 +916,14 @@ public function hasIpv6() } /** - *`ipv6` ensures that the field `value` is a valid IPv6 address in byte format. - *If the field value doesn't meet this constraint, an error message is generated. - *```proto - *message MyBytes { - * // value must be a valid IPv6 address - * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; - *} - *``` + * `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + * If the field value doesn't meet this constraint, an error message is generated. + * ```proto + * message MyBytes { + * // value must be a valid IPv6 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + * } + * ``` * * Generated from protobuf field bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { * @param bool $var diff --git a/src/Buf/Validate/DoubleRules.php b/src/Buf/Validate/DoubleRules.php index eee713a..a965ee9 100644 --- a/src/Buf/Validate/DoubleRules.php +++ b/src/Buf/Validate/DoubleRules.php @@ -17,14 +17,14 @@ class DoubleRules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```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 [json_name = "const", (.buf.validate.priv.field) = { */ @@ -33,32 +33,32 @@ class DoubleRules extends \Google\Protobuf\Internal\Message * `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] - * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyDouble { + * // value must be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyDouble { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ private $not_in; /** - *`finite` requires the field value to be finite. If the field value is + * `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 bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { @@ -74,88 +74,88 @@ class DoubleRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type float $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyDouble { + * // value must equal 42.0 * double value = 1 [(buf.validate.field).double.const = 42.0]; - * } - * ``` + * } + * ``` * @type float $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 + * ```proto + * message MyDouble { + * // value must be less than 10.0 * double value = 1 [(buf.validate.field).double.lt = 10.0]; - * } - * ``` + * } + * ``` * @type float $lte - * `lte` requires the field value to be less than or equal to the specified value + * `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 + * ```proto + * message MyDouble { + * // value must be less than or equal to 10.0 * double value = 1 [(buf.validate.field).double.lte = 10.0]; - * } - * ``` + * } + * ``` * @type float $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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type float $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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in * `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] - * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; - * } - * ``` + * ```proto + * message MyDouble { + * // value must be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; - * } - * ``` + * ```proto + * message MyDouble { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * @type bool $finite - * `finite` requires the field value to be finite. If the field value is + * `finite` requires the field value to be finite. If the field value is * infinite or NaN, an error message is generated. * } */ @@ -165,14 +165,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```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 [json_name = "const", (.buf.validate.priv.field) = { * @return float @@ -193,14 +193,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```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 [json_name = "const", (.buf.validate.priv.field) = { * @param float $var @@ -218,12 +218,12 @@ public function setConst($var) * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return float @@ -242,12 +242,12 @@ public function hasLt() * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param float $var @@ -262,15 +262,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified value + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return float @@ -286,15 +286,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified value + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param float $var @@ -314,16 +314,16 @@ public function setLte($var) * 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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @return float @@ -344,16 +344,16 @@ public function hasGt() * 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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @param float $var @@ -373,16 +373,16 @@ public function setGt($var) * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @return float @@ -403,16 +403,16 @@ public function hasGte() * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @param float $var @@ -430,12 +430,12 @@ public function setGte($var) * `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] - * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyDouble { + * // value must be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -449,12 +449,12 @@ public function getIn() * `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] - * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyDouble { + * // value must be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -469,15 +469,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyDouble { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -488,15 +488,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyDouble { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -511,7 +511,7 @@ public function setNotIn($var) } /** - *`finite` requires the field value to be finite. If the field value is + * `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 bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { @@ -523,7 +523,7 @@ public function getFinite() } /** - *`finite` requires the field value to be finite. If the field value is + * `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 bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { diff --git a/src/Buf/Validate/DurationRules.php b/src/Buf/Validate/DurationRules.php index c518de6..5424477 100644 --- a/src/Buf/Validate/DurationRules.php +++ b/src/Buf/Validate/DurationRules.php @@ -16,44 +16,44 @@ class DurationRules extends \Google\Protobuf\Internal\Message { /** - *`const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. - *If the field's value deviates from the specified value, an error message - *will be generated. - *```proto - *message MyDuration { - * // value must equal 5s + * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + * If the field's value deviates from the specified value, an error message + * will be generated. + * ```proto + * message MyDuration { + * // value must equal 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. - *If the field's value doesn't correspond to any of the specified values, - *an error message will be generated. - *```proto - *message MyDuration { - * // value must be in list [1s, 2s, 3s] + * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + * If the field's value doesn't correspond to any of the specified values, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` denotes that the field must not be equal to - *any of the specified values of the `google.protobuf.Duration` type. - *If the field's value matches any of these values, an error message will be - *generated. - *```proto - *message MyDuration { - * // value must not be in list [1s, 2s, 3s] + * `not_in` denotes that the field must not be equal to + * any of the specified values of the `google.protobuf.Duration` type. + * If the field's value matches any of these values, an error message will be + * generated. + * ```proto + * message MyDuration { + * // value must not be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -68,88 +68,88 @@ class DurationRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Protobuf\Duration $const - * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. - * If the field's value deviates from the specified value, an error message - * will be generated. - * ```proto - * message MyDuration { - * // value must equal 5s + * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + * If the field's value deviates from the specified value, an error message + * will be generated. + * ```proto + * message MyDuration { + * // value must equal 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; - * } - * ``` + * } + * ``` * @type \Google\Protobuf\Duration $lt - * `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, - * exclusive. If the field's value is greater than or equal to the specified - * value, an error message will be generated. - * ```proto - * message MyDuration { - * // value must be less than 5s + * `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + * exclusive. If the field's value is greater than or equal to the specified + * value, an error message will be generated. + * ```proto + * message MyDuration { + * // value must be less than 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; - * } - * ``` + * } + * ``` * @type \Google\Protobuf\Duration $lte - * `lte` indicates that the field must be less than or equal to the specified - * value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, - * an error message will be generated. - * ```proto - * message MyDuration { - * // value must be less than or equal to 10s + * `lte` indicates that the field must be less than or equal to the specified + * value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be less than or equal to 10s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; - * } - * ``` + * } + * ``` * @type \Google\Protobuf\Duration $gt * `gt` requires the duration 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 MyDuration { - * // duration must be greater than 5s [duration.gt] - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; - * // duration must be greater than 5s and less than 10s [duration.gt_lt] - * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; - * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] - * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; - * } - * ``` + * ```proto + * message MyDuration { + * // duration must be greater than 5s [duration.gt] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + * // duration must be greater than 5s and less than 10s [duration.gt_lt] + * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + * } + * ``` * @type \Google\Protobuf\Duration $gte * `gte` requires the duration 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 MyDuration { + * ```proto + * message MyDuration { * // duration must be greater than or equal to 5s [duration.gte] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; * // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; * // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; - * } - * ``` + * } + * ``` * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $in - * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. - * If the field's value doesn't correspond to any of the specified values, - * an error message will be generated. - * ```proto - * message MyDuration { - * // value must be in list [1s, 2s, 3s] + * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + * If the field's value doesn't correspond to any of the specified values, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; - * } - * ``` + * } + * ``` * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` denotes that the field must not be equal to - * any of the specified values of the `google.protobuf.Duration` type. - * If the field's value matches any of these values, an error message will be - * generated. - * ```proto - * message MyDuration { - * // value must not be in list [1s, 2s, 3s] + * `not_in` denotes that the field must not be equal to + * any of the specified values of the `google.protobuf.Duration` type. + * If the field's value matches any of these values, an error message will be + * generated. + * ```proto + * message MyDuration { + * // value must not be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; - * } - * ``` + * } + * ``` * } */ public function __construct($data = NULL) { @@ -158,15 +158,15 @@ public function __construct($data = NULL) { } /** - *`const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. - *If the field's value deviates from the specified value, an error message - *will be generated. - *```proto - *message MyDuration { - * // value must equal 5s + * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + * If the field's value deviates from the specified value, an error message + * will be generated. + * ```proto + * message MyDuration { + * // value must equal 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Duration|null @@ -187,15 +187,15 @@ public function clearConst() } /** - *`const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. - *If the field's value deviates from the specified value, an error message - *will be generated. - *```proto - *message MyDuration { - * // value must equal 5s + * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + * If the field's value deviates from the specified value, an error message + * will be generated. + * ```proto + * message MyDuration { + * // value must equal 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Duration $var @@ -210,15 +210,15 @@ public function setConst($var) } /** - *`lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, - *exclusive. If the field's value is greater than or equal to the specified - *value, an error message will be generated. - *```proto - *message MyDuration { - * // value must be less than 5s + * `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + * exclusive. If the field's value is greater than or equal to the specified + * value, an error message will be generated. + * ```proto + * message MyDuration { + * // value must be less than 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Duration|null @@ -234,15 +234,15 @@ public function hasLt() } /** - *`lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, - *exclusive. If the field's value is greater than or equal to the specified - *value, an error message will be generated. - *```proto - *message MyDuration { - * // value must be less than 5s + * `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + * exclusive. If the field's value is greater than or equal to the specified + * value, an error message will be generated. + * ```proto + * message MyDuration { + * // value must be less than 5s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Duration $var @@ -257,15 +257,15 @@ public function setLt($var) } /** - *`lte` indicates that the field must be less than or equal to the specified - *value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, - *an error message will be generated. - *```proto - *message MyDuration { - * // value must be less than or equal to 10s + * `lte` indicates that the field must be less than or equal to the specified + * value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be less than or equal to 10s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Duration|null @@ -281,15 +281,15 @@ public function hasLte() } /** - *`lte` indicates that the field must be less than or equal to the specified - *value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, - *an error message will be generated. - *```proto - *message MyDuration { - * // value must be less than or equal to 10s + * `lte` indicates that the field must be less than or equal to the specified + * value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be less than or equal to 10s * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; - *} - *``` + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Duration $var @@ -309,16 +309,16 @@ public function setLte($var) * 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 MyDuration { - * // duration must be greater than 5s [duration.gt] - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; - * // duration must be greater than 5s and less than 10s [duration.gt_lt] - * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; - * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] - * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; - *} - *``` + * ```proto + * message MyDuration { + * // duration must be greater than 5s [duration.gt] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + * // duration must be greater than 5s and less than 10s [duration.gt_lt] + * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Duration|null @@ -339,16 +339,16 @@ public function hasGt() * 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 MyDuration { - * // duration must be greater than 5s [duration.gt] - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; - * // duration must be greater than 5s and less than 10s [duration.gt_lt] - * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; - * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] - * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; - *} - *``` + * ```proto + * message MyDuration { + * // duration must be greater than 5s [duration.gt] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + * // duration must be greater than 5s and less than 10s [duration.gt_lt] + * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Duration $var @@ -368,16 +368,16 @@ public function setGt($var) * 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 MyDuration { + * ```proto + * message MyDuration { * // duration must be greater than or equal to 5s [duration.gte] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; * // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; * // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; - *} - *``` + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Duration|null @@ -398,16 +398,16 @@ public function hasGte() * 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 MyDuration { + * ```proto + * message MyDuration { * // duration must be greater than or equal to 5s [duration.gte] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; * // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; * // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; - *} - *``` + * } + * ``` * * Generated from protobuf field .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Duration $var @@ -422,15 +422,15 @@ public function setGte($var) } /** - *`in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. - *If the field's value doesn't correspond to any of the specified values, - *an error message will be generated. - *```proto - *message MyDuration { - * // value must be in list [1s, 2s, 3s] + * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + * If the field's value doesn't correspond to any of the specified values, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -441,15 +441,15 @@ public function getIn() } /** - *`in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. - *If the field's value doesn't correspond to any of the specified values, - *an error message will be generated. - *```proto - *message MyDuration { - * // value must be in list [1s, 2s, 3s] + * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + * If the field's value doesn't correspond to any of the specified values, + * an error message will be generated. + * ```proto + * message MyDuration { + * // value must be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var @@ -464,16 +464,16 @@ public function setIn($var) } /** - *`not_in` denotes that the field must not be equal to - *any of the specified values of the `google.protobuf.Duration` type. - *If the field's value matches any of these values, an error message will be - *generated. - *```proto - *message MyDuration { - * // value must not be in list [1s, 2s, 3s] + * `not_in` denotes that the field must not be equal to + * any of the specified values of the `google.protobuf.Duration` type. + * If the field's value matches any of these values, an error message will be + * generated. + * ```proto + * message MyDuration { + * // value must not be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -484,16 +484,16 @@ public function getNotIn() } /** - *`not_in` denotes that the field must not be equal to - *any of the specified values of the `google.protobuf.Duration` type. - *If the field's value matches any of these values, an error message will be - *generated. - *```proto - *message MyDuration { - * // value must not be in list [1s, 2s, 3s] + * `not_in` denotes that the field must not be equal to + * any of the specified values of the `google.protobuf.Duration` type. + * If the field's value matches any of these values, an error message will be + * generated. + * ```proto + * message MyDuration { + * // value must not be in list [1s, 2s, 3s] * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; - *} - *``` + * } + * ``` * * Generated from protobuf field repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/EnumRules.php b/src/Buf/Validate/EnumRules.php index 6966faf..0925f9b 100644 --- a/src/Buf/Validate/EnumRules.php +++ b/src/Buf/Validate/EnumRules.php @@ -16,75 +16,75 @@ class EnumRules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified enum value. - *If the field value doesn't match, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be exactly MY_ENUM_VALUE1. + * `const` requires the field value to exactly match the specified enum value. + * If the field value doesn't match, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be exactly MY_ENUM_VALUE1. * MyEnum value = 1 [(buf.validate.field).enum.const = 1]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`defined_only` requires the field value to be one of the defined values for + * `defined_only` requires the field value to be one of the defined values for * this enum, failing on any undefined value. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be a defined value of MyEnum. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be a defined value of MyEnum. * MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool defined_only = 2 [json_name = "definedOnly"]; */ protected $defined_only = null; /** - *`in` requires the field value to be equal to one of the + * `in` requires the field value to be equal to one of the *specified enum values. If the field value doesn't match any of the *specified values, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; - *} - *``` + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be equal to one of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + * } + * ``` * * Generated from protobuf field repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to be not equal to any of the + * `not_in` requires the field value to be not equal to any of the *specified enum values. If the field value matches one of the specified - *values, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; - *} - *``` + * values, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must not be equal to any of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + * } + * ``` * * Generated from protobuf field repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -97,63 +97,63 @@ class EnumRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $const - * `const` requires the field value to exactly match the specified enum value. - * If the field value doesn't match, an error message is generated. - * ```proto - * enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - * } - * message MyMessage { - * // The field `value` must be exactly MY_ENUM_VALUE1. + * `const` requires the field value to exactly match the specified enum value. + * If the field value doesn't match, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be exactly MY_ENUM_VALUE1. * MyEnum value = 1 [(buf.validate.field).enum.const = 1]; - * } - * ``` + * } + * ``` * @type bool $defined_only - * `defined_only` requires the field value to be one of the defined values for + * `defined_only` requires the field value to be one of the defined values for * this enum, failing on any undefined value. - * ```proto - * enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - * } - * message MyMessage { - * // The field `value` must be a defined value of MyEnum. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be a defined value of MyEnum. * MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; - * } - * ``` + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the + * `in` requires the field value to be equal to one of the * specified enum values. If the field value doesn't match any of the * specified values, an error message is generated. - * ```proto - * enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - * } - * message MyMessage { - * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; - * } - * ``` + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be equal to one of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to be not equal to any of the + * `not_in` requires the field value to be not equal to any of the * specified enum values. If the field value matches one of the specified - * values, an error message is generated. - * ```proto - * enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - * } - * message MyMessage { - * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; - * } - * ``` + * values, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must not be equal to any of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -162,19 +162,19 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified enum value. - *If the field value doesn't match, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be exactly MY_ENUM_VALUE1. + * `const` requires the field value to exactly match the specified enum value. + * If the field value doesn't match, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be exactly MY_ENUM_VALUE1. * MyEnum value = 1 [(buf.validate.field).enum.const = 1]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int @@ -195,19 +195,19 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified enum value. - *If the field value doesn't match, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be exactly MY_ENUM_VALUE1. + * `const` requires the field value to exactly match the specified enum value. + * If the field value doesn't match, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be exactly MY_ENUM_VALUE1. * MyEnum value = 1 [(buf.validate.field).enum.const = 1]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int $var @@ -222,19 +222,19 @@ public function setConst($var) } /** - *`defined_only` requires the field value to be one of the defined values for + * `defined_only` requires the field value to be one of the defined values for * this enum, failing on any undefined value. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be a defined value of MyEnum. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be a defined value of MyEnum. * MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool defined_only = 2 [json_name = "definedOnly"]; * @return bool @@ -255,19 +255,19 @@ public function clearDefinedOnly() } /** - *`defined_only` requires the field value to be one of the defined values for + * `defined_only` requires the field value to be one of the defined values for * this enum, failing on any undefined value. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be a defined value of MyEnum. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be a defined value of MyEnum. * MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool defined_only = 2 [json_name = "definedOnly"]; * @param bool $var @@ -282,20 +282,20 @@ public function setDefinedOnly($var) } /** - *`in` requires the field value to be equal to one of the + * `in` requires the field value to be equal to one of the *specified enum values. If the field value doesn't match any of the *specified values, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; - *} - *``` + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be equal to one of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + * } + * ``` * * Generated from protobuf field repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -306,20 +306,20 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the + * `in` requires the field value to be equal to one of the *specified enum values. If the field value doesn't match any of the *specified values, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; - *} - *``` + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must be equal to one of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + * } + * ``` * * Generated from protobuf field repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -334,20 +334,20 @@ public function setIn($var) } /** - *`not_in` requires the field value to be not equal to any of the + * `not_in` requires the field value to be not equal to any of the *specified enum values. If the field value matches one of the specified - *values, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; - *} - *``` + * values, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must not be equal to any of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + * } + * ``` * * Generated from protobuf field repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -358,20 +358,20 @@ public function getNotIn() } /** - *`not_in` requires the field value to be not equal to any of the + * `not_in` requires the field value to be not equal to any of the *specified enum values. If the field value matches one of the specified - *values, an error message is generated. - *```proto - *enum MyEnum { - * MY_ENUM_UNSPECIFIED = 0; - * MY_ENUM_VALUE1 = 1; - * MY_ENUM_VALUE2 = 2; - *} - *message MyMessage { - * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; - *} - *``` + * values, an error message is generated. + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * message MyMessage { + * // The field `value` must not be equal to any of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + * } + * ``` * * Generated from protobuf field repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/FieldConstraints.php b/src/Buf/Validate/FieldConstraints.php index 80143d5..fd77ef3 100644 --- a/src/Buf/Validate/FieldConstraints.php +++ b/src/Buf/Validate/FieldConstraints.php @@ -17,61 +17,72 @@ class FieldConstraints extends \Google\Protobuf\Internal\Message { /** - * `Constraint` is a repeated field used to represent a textual expression + * `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", - * }]; - *} - *``` + * ```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 [json_name = "cel"]; */ private $cel; /** - *`skipped` is an optional boolean attribute that specifies that the - *validation rules of this field should not be evaluated. If skipped is set to - *true, any validation rules set for the field will be ignored. - *```proto - *message MyMessage { - * // The field `value` must not be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; - *} - *``` + * `skipped` is an optional boolean attribute that specifies that the + * validation rules of this field should not be evaluated. If skipped is set to + * true, any validation rules set for the field will be ignored. + * ```proto + * message MyMessage { + * // The field `value` must not be set. + * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; + * } + * ``` * * Generated from protobuf field bool skipped = 24 [json_name = "skipped"]; */ protected $skipped = false; /** - *`required` is an optional boolean attribute that specifies that - *this field must be set. If required is set to true, the field value must - *not be empty; otherwise, an error message will be generated. - *```proto - *message MyMessage { - * // The field `value` must be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; - *} - *``` + * If `required` is true, the field must be populated. Field presence can be + * described as "serialized in the wire format," which follows the following rules: + * - the following "nullable" fields must be explicitly set to be considered present: + * - singular message fields (may be their empty value) + * - member fields of a oneof (may be their default value) + * - proto3 optional fields (may be their default value) + * - proto2 scalar fields + * - proto3 scalar fields must be non-zero to be considered present + * - repeated and map fields must be non-empty to be considered present + * ```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 bool required = 25 [json_name = "required"]; */ protected $required = false; /** - *`ignore_empty` specifies that the validation rules of this field should be - *evaluated only if the field isn't empty. If the field is empty, no validation - *rules are applied. - *```proto - *message MyRepeated { - * // The field `value` validation rules should be evaluated only if the field isn't empty. - * repeated string value = 1 [(buf.validate.field).ignore_empty = true]; - *} - *``` + * If `ignore_empty` is true and applied to a non-nullable field (see + * `required` for more details), validation is skipped on the field if it is + * the default or empty value. Adding `ignore_empty` to a "nullable" field is + * a noop as these unset fields already skip validation (with the exception + * of `required`). + * ```proto + * message MyRepeated { + * // The field `value` min_len rule is only applied if the field isn't empty. + * repeated string value = 1 [ + * (buf.validate.field).ignore_empty = true, + * (buf.validate.field).min_len = 5 + * ]; + * } + * ``` * * Generated from protobuf field bool ignore_empty = 26 [json_name = "ignoreEmpty"]; */ @@ -85,49 +96,60 @@ class FieldConstraints extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array<\Buf\Validate\Constraint>|\Google\Protobuf\Internal\RepeatedField $cel - * `Constraint` is a repeated field used to represent a textual expression + * `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", - * }]; - * } - * ``` + * ```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", + * }]; + * } + * ``` * @type bool $skipped - * `skipped` is an optional boolean attribute that specifies that the - * validation rules of this field should not be evaluated. If skipped is set to - * true, any validation rules set for the field will be ignored. - * ```proto - * message MyMessage { - * // The field `value` must not be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; - * } - * ``` + * `skipped` is an optional boolean attribute that specifies that the + * validation rules of this field should not be evaluated. If skipped is set to + * true, any validation rules set for the field will be ignored. + * ```proto + * message MyMessage { + * // The field `value` must not be set. + * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; + * } + * ``` * @type bool $required - * `required` is an optional boolean attribute that specifies that - * this field must be set. If required is set to true, the field value must - * not be empty; otherwise, an error message will be generated. - * ```proto - * message MyMessage { - * // The field `value` must be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; - * } - * ``` + * If `required` is true, the field must be populated. Field presence can be + * described as "serialized in the wire format," which follows the following rules: + * - the following "nullable" fields must be explicitly set to be considered present: + * - singular message fields (may be their empty value) + * - member fields of a oneof (may be their default value) + * - proto3 optional fields (may be their default value) + * - proto2 scalar fields + * - proto3 scalar fields must be non-zero to be considered present + * - repeated and map fields must be non-empty to be considered present + * ```proto + * message MyMessage { + * // The field `value` must be set to a non-null value. + * optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; + * } + * ``` * @type bool $ignore_empty - * `ignore_empty` specifies that the validation rules of this field should be - * evaluated only if the field isn't empty. If the field is empty, no validation - * rules are applied. - * ```proto - * message MyRepeated { - * // The field `value` validation rules should be evaluated only if the field isn't empty. - * repeated string value = 1 [(buf.validate.field).ignore_empty = true]; - * } - * ``` + * If `ignore_empty` is true and applied to a non-nullable field (see + * `required` for more details), validation is skipped on the field if it is + * the default or empty value. Adding `ignore_empty` to a "nullable" field is + * a noop as these unset fields already skip validation (with the exception + * of `required`). + * ```proto + * message MyRepeated { + * // The field `value` min_len rule is only applied if the field isn't empty. + * repeated string value = 1 [ + * (buf.validate.field).ignore_empty = true, + * (buf.validate.field).min_len = 5 + * ]; + * } + * ``` * @type \Buf\Validate\FloatRules $float * Scalar Field Types * @type \Buf\Validate\DoubleRules $double @@ -160,19 +182,19 @@ public function __construct($data = NULL) { } /** - * `Constraint` is a repeated field used to represent a textual expression + * `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", - * }]; - *} - *``` + * ```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 [json_name = "cel"]; * @return \Google\Protobuf\Internal\RepeatedField @@ -183,19 +205,19 @@ public function getCel() } /** - * `Constraint` is a repeated field used to represent a textual expression + * `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", - * }]; - *} - *``` + * ```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 [json_name = "cel"]; * @param array<\Buf\Validate\Constraint>|\Google\Protobuf\Internal\RepeatedField $var @@ -210,15 +232,15 @@ public function setCel($var) } /** - *`skipped` is an optional boolean attribute that specifies that the - *validation rules of this field should not be evaluated. If skipped is set to - *true, any validation rules set for the field will be ignored. - *```proto - *message MyMessage { - * // The field `value` must not be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; - *} - *``` + * `skipped` is an optional boolean attribute that specifies that the + * validation rules of this field should not be evaluated. If skipped is set to + * true, any validation rules set for the field will be ignored. + * ```proto + * message MyMessage { + * // The field `value` must not be set. + * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; + * } + * ``` * * Generated from protobuf field bool skipped = 24 [json_name = "skipped"]; * @return bool @@ -229,15 +251,15 @@ public function getSkipped() } /** - *`skipped` is an optional boolean attribute that specifies that the - *validation rules of this field should not be evaluated. If skipped is set to - *true, any validation rules set for the field will be ignored. - *```proto - *message MyMessage { - * // The field `value` must not be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; - *} - *``` + * `skipped` is an optional boolean attribute that specifies that the + * validation rules of this field should not be evaluated. If skipped is set to + * true, any validation rules set for the field will be ignored. + * ```proto + * message MyMessage { + * // The field `value` must not be set. + * optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true]; + * } + * ``` * * Generated from protobuf field bool skipped = 24 [json_name = "skipped"]; * @param bool $var @@ -252,15 +274,21 @@ public function setSkipped($var) } /** - *`required` is an optional boolean attribute that specifies that - *this field must be set. If required is set to true, the field value must - *not be empty; otherwise, an error message will be generated. - *```proto - *message MyMessage { - * // The field `value` must be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; - *} - *``` + * If `required` is true, the field must be populated. Field presence can be + * described as "serialized in the wire format," which follows the following rules: + * - the following "nullable" fields must be explicitly set to be considered present: + * - singular message fields (may be their empty value) + * - member fields of a oneof (may be their default value) + * - proto3 optional fields (may be their default value) + * - proto2 scalar fields + * - proto3 scalar fields must be non-zero to be considered present + * - repeated and map fields must be non-empty to be considered present + * ```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 bool required = 25 [json_name = "required"]; * @return bool @@ -271,15 +299,21 @@ public function getRequired() } /** - *`required` is an optional boolean attribute that specifies that - *this field must be set. If required is set to true, the field value must - *not be empty; otherwise, an error message will be generated. - *```proto - *message MyMessage { - * // The field `value` must be set. - * optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; - *} - *``` + * If `required` is true, the field must be populated. Field presence can be + * described as "serialized in the wire format," which follows the following rules: + * - the following "nullable" fields must be explicitly set to be considered present: + * - singular message fields (may be their empty value) + * - member fields of a oneof (may be their default value) + * - proto3 optional fields (may be their default value) + * - proto2 scalar fields + * - proto3 scalar fields must be non-zero to be considered present + * - repeated and map fields must be non-empty to be considered present + * ```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 bool required = 25 [json_name = "required"]; * @param bool $var @@ -294,15 +328,20 @@ public function setRequired($var) } /** - *`ignore_empty` specifies that the validation rules of this field should be - *evaluated only if the field isn't empty. If the field is empty, no validation - *rules are applied. - *```proto - *message MyRepeated { - * // The field `value` validation rules should be evaluated only if the field isn't empty. - * repeated string value = 1 [(buf.validate.field).ignore_empty = true]; - *} - *``` + * If `ignore_empty` is true and applied to a non-nullable field (see + * `required` for more details), validation is skipped on the field if it is + * the default or empty value. Adding `ignore_empty` to a "nullable" field is + * a noop as these unset fields already skip validation (with the exception + * of `required`). + * ```proto + * message MyRepeated { + * // The field `value` min_len rule is only applied if the field isn't empty. + * repeated string value = 1 [ + * (buf.validate.field).ignore_empty = true, + * (buf.validate.field).min_len = 5 + * ]; + * } + * ``` * * Generated from protobuf field bool ignore_empty = 26 [json_name = "ignoreEmpty"]; * @return bool @@ -313,15 +352,20 @@ public function getIgnoreEmpty() } /** - *`ignore_empty` specifies that the validation rules of this field should be - *evaluated only if the field isn't empty. If the field is empty, no validation - *rules are applied. - *```proto - *message MyRepeated { - * // The field `value` validation rules should be evaluated only if the field isn't empty. - * repeated string value = 1 [(buf.validate.field).ignore_empty = true]; - *} - *``` + * If `ignore_empty` is true and applied to a non-nullable field (see + * `required` for more details), validation is skipped on the field if it is + * the default or empty value. Adding `ignore_empty` to a "nullable" field is + * a noop as these unset fields already skip validation (with the exception + * of `required`). + * ```proto + * message MyRepeated { + * // The field `value` min_len rule is only applied if the field isn't empty. + * repeated string value = 1 [ + * (buf.validate.field).ignore_empty = true, + * (buf.validate.field).min_len = 5 + * ]; + * } + * ``` * * Generated from protobuf field bool ignore_empty = 26 [json_name = "ignoreEmpty"]; * @param bool $var diff --git a/src/Buf/Validate/Fixed32Rules.php b/src/Buf/Validate/Fixed32Rules.php index 3f4e89e..1436bd8 100644 --- a/src/Buf/Validate/Fixed32Rules.php +++ b/src/Buf/Validate/Fixed32Rules.php @@ -16,42 +16,42 @@ class Fixed32Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. + * `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 MyFixed32 { - * // value must equal 42 + * ```proto + * message MyFixed32 { + * // value must equal 42 * fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MyFixed32 { - * // value must be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed32 { - * // value must not be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must not be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -66,86 +66,86 @@ class Fixed32Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $const - * `const` requires the field value to exactly match the specified value. + * `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 MyFixed32 { - * // value must equal 42 + * ```proto + * message MyFixed32 { + * // value must equal 42 * fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; - * } - * ``` + * } + * ``` * @type int $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 MyFixed32 { - * // value must be less than 10 + * ```proto + * message MyFixed32 { + * // value must be less than 10 * fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; - * } - * ``` + * } + * ``` * @type int $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 MyFixed32 { - * // value must be less than or equal to 10 + * ```proto + * message MyFixed32 { + * // value must be less than or equal to 10 * fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; - * } - * ``` + * } + * ``` * @type int $gt - * `gt` requires the field value to be greater than the specified value + * `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 MyFixed32 { - * // value must be greater than 5 [fixed32.gt] - * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; - * // value must be greater than 5 and less than 10 [fixed32.gt_lt] - * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] - * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MyFixed32 { + * // value must be greater than 5 [fixed32.gt] + * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + * // value must be greater than 5 and less than 10 [fixed32.gt_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + * } + * ``` * @type int $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 MyFixed32 { - * // value must be greater than or equal to 5 [fixed32.gte] - * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] - * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] - * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MyFixed32 { + * // value must be greater than or equal to 5 [fixed32.gte] + * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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 MyFixed32 { - * // value must be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyFixed32 { + * // value must be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed32 { - * // value must not be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyFixed32 { + * // value must not be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -154,14 +154,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. + * `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 MyFixed32 { - * // value must equal 42 + * ```proto + * message MyFixed32 { + * // value must equal 42 * fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int @@ -182,14 +182,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. + * `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 MyFixed32 { - * // value must equal 42 + * ```proto + * message MyFixed32 { + * // value must equal 42 * fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int $var @@ -204,15 +204,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MyFixed32 { - * // value must be less than 10 + * ```proto + * message MyFixed32 { + * // value must be less than 10 * fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @return int @@ -228,15 +228,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MyFixed32 { - * // value must be less than 10 + * ```proto + * message MyFixed32 { + * // value must be less than 10 * fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @param int $var @@ -251,15 +251,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MyFixed32 { - * // value must be less than or equal to 10 + * ```proto + * message MyFixed32 { + * // value must be less than or equal to 10 * fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @return int @@ -275,15 +275,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MyFixed32 { - * // value must be less than or equal to 10 + * ```proto + * message MyFixed32 { + * // value must be less than or equal to 10 * fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @param int $var @@ -298,21 +298,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 MyFixed32 { - * // value must be greater than 5 [fixed32.gt] - * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; - * // value must be greater than 5 and less than 10 [fixed32.gt_lt] - * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] - * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be greater than 5 [fixed32.gt] + * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + * // value must be greater than 5 and less than 10 [fixed32.gt_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @return int @@ -328,21 +328,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 MyFixed32 { - * // value must be greater than 5 [fixed32.gt] - * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; - * // value must be greater than 5 and less than 10 [fixed32.gt_lt] - * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] - * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be greater than 5 [fixed32.gt] + * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + * // value must be greater than 5 and less than 10 [fixed32.gt_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @param int $var @@ -357,21 +357,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MyFixed32 { - * // value must be greater than or equal to 5 [fixed32.gte] - * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] - * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] - * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be greater than or equal to 5 [fixed32.gte] + * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @return int @@ -387,21 +387,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MyFixed32 { - * // value must be greater than or equal to 5 [fixed32.gte] - * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] - * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] - * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be greater than or equal to 5 [fixed32.gte] + * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @param int $var @@ -416,15 +416,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MyFixed32 { - * // value must be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -435,15 +435,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MyFixed32 { - * // value must be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -458,15 +458,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed32 { - * // value must not be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must not be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -477,15 +477,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed32 { - * // value must not be in list [1, 2, 3] - * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed32 { + * // value must not be in list [1, 2, 3] + * repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/Fixed64Rules.php b/src/Buf/Validate/Fixed64Rules.php index fb9f553..39a9c81 100644 --- a/src/Buf/Validate/Fixed64Rules.php +++ b/src/Buf/Validate/Fixed64Rules.php @@ -16,42 +16,42 @@ class Fixed64Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 MyFixed64 { - * // value must equal 42 + * ```proto + * message MyFixed64 { + * // value must equal 42 * fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MyFixed64 { - * // value must be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed64 { - * // value must not be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must not be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -66,86 +66,86 @@ class Fixed64Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $const - * `const` requires the field value to exactly match the specified value. If + * `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 MyFixed64 { - * // value must equal 42 + * ```proto + * message MyFixed64 { + * // value must equal 42 * fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; - * } - * ``` + * } + * ``` * @type int|string $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 MyFixed64 { - * // value must be less than 10 + * ```proto + * message MyFixed64 { + * // value must be less than 10 * fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; - * } - * ``` + * } + * ``` * @type int|string $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 MyFixed64 { - * // value must be less than or equal to 10 + * ```proto + * message MyFixed64 { + * // value must be less than or equal to 10 * fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; - * } - * ``` + * } + * ``` * @type int|string $gt - * `gt` requires the field value to be greater than the specified value + * `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 MyFixed64 { - * // value must be greater than 5 [fixed64.gt] - * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; - * // value must be greater than 5 and less than 10 [fixed64.gt_lt] - * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] - * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MyFixed64 { + * // value must be greater than 5 [fixed64.gt] + * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + * // value must be greater than 5 and less than 10 [fixed64.gt_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + * } + * ``` * @type int|string $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 MyFixed64 { - * // value must be greater than or equal to 5 [fixed64.gte] - * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] - * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] - * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MyFixed64 { + * // value must be greater than or equal to 5 [fixed64.gte] + * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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 MyFixed64 { - * // value must be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyFixed64 { + * // value must be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed64 { - * // value must not be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyFixed64 { + * // value must not be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -154,14 +154,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MyFixed64 { - * // value must equal 42 + * ```proto + * message MyFixed64 { + * // value must equal 42 * fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int|string @@ -182,14 +182,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MyFixed64 { - * // value must equal 42 + * ```proto + * message MyFixed64 { + * // value must equal 42 * fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int|string $var @@ -204,15 +204,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MyFixed64 { - * // value must be less than 10 + * ```proto + * message MyFixed64 { + * // value must be less than 10 * fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @return int|string @@ -228,15 +228,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MyFixed64 { - * // value must be less than 10 + * ```proto + * message MyFixed64 { + * // value must be less than 10 * fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @param int|string $var @@ -251,15 +251,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MyFixed64 { - * // value must be less than or equal to 10 + * ```proto + * message MyFixed64 { + * // value must be less than or equal to 10 * fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @return int|string @@ -275,15 +275,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MyFixed64 { - * // value must be less than or equal to 10 + * ```proto + * message MyFixed64 { + * // value must be less than or equal to 10 * fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @param int|string $var @@ -298,21 +298,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 MyFixed64 { - * // value must be greater than 5 [fixed64.gt] - * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; - * // value must be greater than 5 and less than 10 [fixed64.gt_lt] - * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] - * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be greater than 5 [fixed64.gt] + * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + * // value must be greater than 5 and less than 10 [fixed64.gt_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @return int|string @@ -328,21 +328,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 MyFixed64 { - * // value must be greater than 5 [fixed64.gt] - * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; - * // value must be greater than 5 and less than 10 [fixed64.gt_lt] - * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] - * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be greater than 5 [fixed64.gt] + * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + * // value must be greater than 5 and less than 10 [fixed64.gt_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @param int|string $var @@ -357,21 +357,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MyFixed64 { - * // value must be greater than or equal to 5 [fixed64.gte] - * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] - * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] - * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be greater than or equal to 5 [fixed64.gte] + * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @return int|string @@ -387,21 +387,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MyFixed64 { - * // value must be greater than or equal to 5 [fixed64.gte] - * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] - * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] - * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be greater than or equal to 5 [fixed64.gte] + * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @param int|string $var @@ -416,15 +416,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MyFixed64 { - * // value must be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -435,15 +435,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MyFixed64 { - * // value must be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var @@ -458,15 +458,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed64 { - * // value must not be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must not be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -477,15 +477,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MyFixed64 { - * // value must not be in list [1, 2, 3] - * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyFixed64 { + * // value must not be in list [1, 2, 3] + * repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/FloatRules.php b/src/Buf/Validate/FloatRules.php index e2fdd2e..342d2fe 100644 --- a/src/Buf/Validate/FloatRules.php +++ b/src/Buf/Validate/FloatRules.php @@ -17,48 +17,48 @@ class FloatRules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```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 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyFloat { + * // value must be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`in` requires the field value to not be equal to any of the specified + * `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] - * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyFloat { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ private $not_in; /** - *`finite` requires the field value to be finite. If the field value is + * `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 bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { @@ -74,88 +74,88 @@ class FloatRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type float $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyFloat { + * // value must equal 42.0 * float value = 1 [(buf.validate.field).float.const = 42.0]; - * } - * ``` + * } + * ``` * @type float $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 + * ```proto + * message MyFloat { + * // value must be less than 10.0 * float value = 1 [(buf.validate.field).float.lt = 10.0]; - * } - * ``` + * } + * ``` * @type float $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 + * ```proto + * message MyFloat { + * // value must be less than or equal to 10.0 * float value = 1 [(buf.validate.field).float.lte = 10.0]; - * } - * ``` + * } + * ``` * @type float $gt - * `gt` requires the field value to be greater than the specified value + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type float $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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] - * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; - * } - * ``` + * ```proto + * message MyFloat { + * // value must be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `in` requires the field value to not be equal to any of the specified + * `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] - * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; - * } - * ``` + * ```proto + * message MyFloat { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * @type bool $finite - * `finite` requires the field value to be finite. If the field value is + * `finite` requires the field value to be finite. If the field value is * infinite or NaN, an error message is generated. * } */ @@ -165,14 +165,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```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 [json_name = "const", (.buf.validate.priv.field) = { * @return float @@ -193,14 +193,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```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 [json_name = "const", (.buf.validate.priv.field) = { * @param float $var @@ -215,15 +215,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return float @@ -239,15 +239,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param float $var @@ -262,15 +262,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return float @@ -286,15 +286,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param float $var @@ -309,21 +309,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @return float @@ -339,21 +339,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @param float $var @@ -368,21 +368,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @return float @@ -398,21 +398,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @param float $var @@ -427,15 +427,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyFloat { + * // value must be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -446,15 +446,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyFloat { + * // value must be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -469,15 +469,15 @@ public function setIn($var) } /** - *`in` requires the field value to not be equal to any of the specified + * `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] - * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyFloat { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -488,15 +488,15 @@ public function getNotIn() } /** - *`in` requires the field value to not be equal to any of the specified + * `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] - * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; - *} - *``` + * ```proto + * message MyFloat { + * // value must not be in list [1.0, 2.0, 3.0] + * repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; + * } + * ``` * * Generated from protobuf field repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -511,7 +511,7 @@ public function setNotIn($var) } /** - *`finite` requires the field value to be finite. If the field value is + * `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 bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { @@ -523,7 +523,7 @@ public function getFinite() } /** - *`finite` requires the field value to be finite. If the field value is + * `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 bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { diff --git a/src/Buf/Validate/Int32Rules.php b/src/Buf/Validate/Int32Rules.php index 2a735d8..d81ffcb 100644 --- a/src/Buf/Validate/Int32Rules.php +++ b/src/Buf/Validate/Int32Rules.php @@ -17,42 +17,42 @@ class Int32Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt32 { + * // value must equal 42 * int32 value = 1 [(buf.validate.field).int32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt32 { + * // value must be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt32 { + * // value must not be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -67,86 +67,86 @@ class Int32Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt32 { + * // value must equal 42 * int32 value = 1 [(buf.validate.field).int32.const = 42]; - * } - * ``` + * } + * ``` * @type int $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 + * ```proto + * message MyInt32 { + * // value must be less than 10 * int32 value = 1 [(buf.validate.field).int32.lt = 10]; - * } - * ``` + * } + * ``` * @type int $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 + * ```proto + * message MyInt32 { + * // value must be less than or equal to 10 * int32 value = 1 [(buf.validate.field).int32.lte = 10]; - * } - * ``` + * } + * ``` * @type int $gt - * `gt` requires the field value to be greater than the specified value + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type int $gte - * `gte` requires the field value to be greater than or equal to the specified value + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyInt32 { + * // value must be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyInt32 { + * // value must not be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -155,14 +155,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt32 { + * // value must equal 42 * int32 value = 1 [(buf.validate.field).int32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int @@ -183,14 +183,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt32 { + * // value must equal 42 * int32 value = 1 [(buf.validate.field).int32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int $var @@ -208,12 +208,12 @@ public function setConst($var) * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return int @@ -232,12 +232,12 @@ public function hasLt() * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param int $var @@ -252,15 +252,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return int @@ -276,15 +276,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param int $var @@ -299,21 +299,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @return int @@ -329,21 +329,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @param int $var @@ -358,21 +358,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @return int @@ -388,21 +388,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @param int $var @@ -417,15 +417,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt32 { + * // value must be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -436,15 +436,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt32 { + * // value must be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -459,15 +459,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt32 { + * // value must not be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -478,15 +478,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt32 { + * // value must not be in list [1, 2, 3] + * repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/Int64Rules.php b/src/Buf/Validate/Int64Rules.php index b75b256..ce48481 100644 --- a/src/Buf/Validate/Int64Rules.php +++ b/src/Buf/Validate/Int64Rules.php @@ -17,42 +17,42 @@ class Int64Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt64 { + * // value must equal 42 * int64 value = 1 [(buf.validate.field).int64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt64 { + * // value must be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt64 { + * // value must not be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -67,86 +67,86 @@ class Int64Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt64 { + * // value must equal 42 * int64 value = 1 [(buf.validate.field).int64.const = 42]; - * } - * ``` + * } + * ``` * @type int|string $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 + * ```proto + * message MyInt64 { + * // value must be less than 10 * int64 value = 1 [(buf.validate.field).int64.lt = 10]; - * } - * ``` + * } + * ``` * @type int|string $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 + * ```proto + * message MyInt64 { + * // value must be less than or equal to 10 * int64 value = 1 [(buf.validate.field).int64.lte = 10]; - * } - * ``` + * } + * ``` * @type int|string $gt - * `gt` requires the field value to be greater than the specified value + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type int|string $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyInt64 { + * // value must be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyInt64 { + * // value must not be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -155,14 +155,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt64 { + * // value must equal 42 * int64 value = 1 [(buf.validate.field).int64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int|string @@ -183,14 +183,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyInt64 { + * // value must equal 42 * int64 value = 1 [(buf.validate.field).int64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int|string $var @@ -205,15 +205,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return int|string @@ -229,15 +229,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param int|string $var @@ -252,15 +252,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return int|string @@ -276,15 +276,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param int|string $var @@ -299,21 +299,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @return int|string @@ -329,21 +329,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @param int|string $var @@ -358,21 +358,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @return int|string @@ -388,21 +388,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @param int|string $var @@ -417,15 +417,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt64 { + * // value must be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -436,15 +436,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt64 { + * // value must be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var @@ -459,15 +459,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt64 { + * // value must not be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -478,15 +478,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyInt64 { + * // value must not be in list [1, 2, 3] + * repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/MapRules.php b/src/Buf/Validate/MapRules.php index 9c807f2..5811bee 100644 --- a/src/Buf/Validate/MapRules.php +++ b/src/Buf/Validate/MapRules.php @@ -17,62 +17,62 @@ class MapRules extends \Google\Protobuf\Internal\Message { /** *Specifies the minimum number of key-value pairs allowed. If the field has - *fewer key-value pairs than specified, an error message is generated. - *```proto - *message MyMap { - * // The field `value` must have at least 2 key-value pairs. - * map value = 1 [(buf.validate.field).map.min_pairs = 2]; - *} - *``` + * fewer key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at least 2 key-value pairs. + * map value = 1 [(buf.validate.field).map.min_pairs = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { */ protected $min_pairs = null; /** *Specifies the maximum number of key-value pairs allowed. If the field has - *more key-value pairs than specified, an error message is generated. - *```proto - *message MyMap { - * // The field `value` must have at most 3 key-value pairs. - * map value = 1 [(buf.validate.field).map.max_pairs = 3]; - *} - *``` + * more key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at most 3 key-value pairs. + * map value = 1 [(buf.validate.field).map.max_pairs = 3]; + * } + * ``` * * Generated from protobuf field optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { */ protected $max_pairs = null; /** *Specifies the constraints to be applied to each key in the field. - *```proto - *message MyMap { - * // The keys in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.keys = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - *} - *``` + * ```proto + * message MyMap { + * // The keys in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.keys = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints keys = 4 [json_name = "keys"]; */ protected $keys = null; /** *Specifies the constraints to be applied to the value of each key in the - *field. Message values will still have their validations evaluated unless + * field. Message values will still have their validations evaluated unless *skip is specified here. - *```proto - *message MyMap { - * // The values in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.values = { - * string: { - * min_len: 5 - * max_len: 20 - * } - * }]; - *} - *``` + * ```proto + * message MyMap { + * // The values in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.values = { + * string: { + * min_len: 5 + * max_len: 20 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints values = 5 [json_name = "values"]; */ @@ -86,50 +86,50 @@ class MapRules extends \Google\Protobuf\Internal\Message * * @type int|string $min_pairs * Specifies the minimum number of key-value pairs allowed. If the field has - * fewer key-value pairs than specified, an error message is generated. - * ```proto - * message MyMap { - * // The field `value` must have at least 2 key-value pairs. - * map value = 1 [(buf.validate.field).map.min_pairs = 2]; - * } - * ``` + * fewer key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at least 2 key-value pairs. + * map value = 1 [(buf.validate.field).map.min_pairs = 2]; + * } + * ``` * @type int|string $max_pairs * Specifies the maximum number of key-value pairs allowed. If the field has - * more key-value pairs than specified, an error message is generated. - * ```proto - * message MyMap { - * // The field `value` must have at most 3 key-value pairs. - * map value = 1 [(buf.validate.field).map.max_pairs = 3]; - * } - * ``` + * more key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at most 3 key-value pairs. + * map value = 1 [(buf.validate.field).map.max_pairs = 3]; + * } + * ``` * @type \Buf\Validate\FieldConstraints $keys * Specifies the constraints to be applied to each key in the field. - * ```proto - * message MyMap { - * // The keys in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.keys = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - * } - * ``` + * ```proto + * message MyMap { + * // The keys in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.keys = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * @type \Buf\Validate\FieldConstraints $values * Specifies the constraints to be applied to the value of each key in the - * field. Message values will still have their validations evaluated unless + * field. Message values will still have their validations evaluated unless * skip is specified here. - * ```proto - * message MyMap { - * // The values in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.values = { - * string: { - * min_len: 5 - * max_len: 20 - * } - * }]; - * } - * ``` + * ```proto + * message MyMap { + * // The values in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.values = { + * string: { + * min_len: 5 + * max_len: 20 + * } + * }]; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -139,13 +139,13 @@ public function __construct($data = NULL) { /** *Specifies the minimum number of key-value pairs allowed. If the field has - *fewer key-value pairs than specified, an error message is generated. - *```proto - *message MyMap { - * // The field `value` must have at least 2 key-value pairs. - * map value = 1 [(buf.validate.field).map.min_pairs = 2]; - *} - *``` + * fewer key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at least 2 key-value pairs. + * map value = 1 [(buf.validate.field).map.min_pairs = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { * @return int|string @@ -167,13 +167,13 @@ public function clearMinPairs() /** *Specifies the minimum number of key-value pairs allowed. If the field has - *fewer key-value pairs than specified, an error message is generated. - *```proto - *message MyMap { - * // The field `value` must have at least 2 key-value pairs. - * map value = 1 [(buf.validate.field).map.min_pairs = 2]; - *} - *``` + * fewer key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at least 2 key-value pairs. + * map value = 1 [(buf.validate.field).map.min_pairs = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { * @param int|string $var @@ -189,13 +189,13 @@ public function setMinPairs($var) /** *Specifies the maximum number of key-value pairs allowed. If the field has - *more key-value pairs than specified, an error message is generated. - *```proto - *message MyMap { - * // The field `value` must have at most 3 key-value pairs. - * map value = 1 [(buf.validate.field).map.max_pairs = 3]; - *} - *``` + * more key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at most 3 key-value pairs. + * map value = 1 [(buf.validate.field).map.max_pairs = 3]; + * } + * ``` * * Generated from protobuf field optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { * @return int|string @@ -217,13 +217,13 @@ public function clearMaxPairs() /** *Specifies the maximum number of key-value pairs allowed. If the field has - *more key-value pairs than specified, an error message is generated. - *```proto - *message MyMap { - * // The field `value` must have at most 3 key-value pairs. - * map value = 1 [(buf.validate.field).map.max_pairs = 3]; - *} - *``` + * more key-value pairs than specified, an error message is generated. + * ```proto + * message MyMap { + * // The field `value` must have at most 3 key-value pairs. + * map value = 1 [(buf.validate.field).map.max_pairs = 3]; + * } + * ``` * * Generated from protobuf field optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { * @param int|string $var @@ -239,17 +239,17 @@ public function setMaxPairs($var) /** *Specifies the constraints to be applied to each key in the field. - *```proto - *message MyMap { - * // The keys in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.keys = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - *} - *``` + * ```proto + * message MyMap { + * // The keys in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.keys = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints keys = 4 [json_name = "keys"]; * @return \Buf\Validate\FieldConstraints|null @@ -271,17 +271,17 @@ public function clearKeys() /** *Specifies the constraints to be applied to each key in the field. - *```proto - *message MyMap { - * // The keys in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.keys = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - *} - *``` + * ```proto + * message MyMap { + * // The keys in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.keys = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints keys = 4 [json_name = "keys"]; * @param \Buf\Validate\FieldConstraints $var @@ -297,19 +297,19 @@ public function setKeys($var) /** *Specifies the constraints to be applied to the value of each key in the - *field. Message values will still have their validations evaluated unless + * field. Message values will still have their validations evaluated unless *skip is specified here. - *```proto - *message MyMap { - * // The values in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.values = { - * string: { - * min_len: 5 - * max_len: 20 - * } - * }]; - *} - *``` + * ```proto + * message MyMap { + * // The values in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.values = { + * string: { + * min_len: 5 + * max_len: 20 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints values = 5 [json_name = "values"]; * @return \Buf\Validate\FieldConstraints|null @@ -331,19 +331,19 @@ public function clearValues() /** *Specifies the constraints to be applied to the value of each key in the - *field. Message values will still have their validations evaluated unless + * field. Message values will still have their validations evaluated unless *skip is specified here. - *```proto - *message MyMap { - * // The values in the field `value` must follow the specified constraints. - * map value = 1 [(buf.validate.field).map.values = { - * string: { - * min_len: 5 - * max_len: 20 - * } - * }]; - *} - *``` + * ```proto + * message MyMap { + * // The values in the field `value` must follow the specified constraints. + * map value = 1 [(buf.validate.field).map.values = { + * string: { + * min_len: 5 + * max_len: 20 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints values = 5 [json_name = "values"]; * @param \Buf\Validate\FieldConstraints $var diff --git a/src/Buf/Validate/MessageConstraints.php b/src/Buf/Validate/MessageConstraints.php index 879aaa6..32dc00e 100644 --- a/src/Buf/Validate/MessageConstraints.php +++ b/src/Buf/Validate/MessageConstraints.php @@ -17,7 +17,7 @@ class MessageConstraints extends \Google\Protobuf\Internal\Message { /** - * disabled is a boolean flag that, when set to true, nullifies any validation rules for this message. + * `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 { @@ -30,20 +30,20 @@ class MessageConstraints extends \Google\Protobuf\Internal\Message */ protected $disabled = null; /** - * cel is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message. + * `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; - *} - *``` + * ```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 [json_name = "cel"]; */ @@ -56,7 +56,7 @@ class MessageConstraints extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type bool $disabled - * disabled is a boolean flag that, when set to true, nullifies any validation rules for this message. + * `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 { @@ -65,20 +65,20 @@ class MessageConstraints extends \Google\Protobuf\Internal\Message * } * ``` * @type array<\Buf\Validate\Constraint>|\Google\Protobuf\Internal\RepeatedField $cel - * cel is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message. + * `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; - * } - * ``` + * ```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; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -87,7 +87,7 @@ public function __construct($data = NULL) { } /** - * disabled is a boolean flag that, when set to true, nullifies any validation rules for this message. + * `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 { @@ -115,7 +115,7 @@ public function clearDisabled() } /** - * disabled is a boolean flag that, when set to true, nullifies any validation rules for this message. + * `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 { @@ -137,20 +137,20 @@ public function setDisabled($var) } /** - * cel is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message. + * `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; - *} - *``` + * ```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 [json_name = "cel"]; * @return \Google\Protobuf\Internal\RepeatedField @@ -161,20 +161,20 @@ public function getCel() } /** - * cel is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message. + * `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; - *} - *``` + * ```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 [json_name = "cel"]; * @param array<\Buf\Validate\Constraint>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/OneofConstraints.php b/src/Buf/Validate/OneofConstraints.php index da07646..82512c4 100644 --- a/src/Buf/Validate/OneofConstraints.php +++ b/src/Buf/Validate/OneofConstraints.php @@ -10,28 +10,29 @@ /** * The `OneofConstraints` message type enables you to manage constraints for - * oneof fields in your protobuf messages. Use the `required` constraint to ensure - * that exactly one of the fields within a oneof is set; validation will fail - * if none of the fields in the oneof are set: + * oneof fields in your protobuf messages. * * Generated from protobuf message buf.validate.OneofConstraints */ class OneofConstraints extends \Google\Protobuf\Internal\Message { /** - *`required` is an optional boolean attribute that ensures that - *exactly one of the field options in a oneof is set; validation fails if - *no fields in the oneof are set. - *```proto - *message MyMessage { - * oneof value { - * // The field `a` or `b` must be set. - * option (buf.validate.oneof).required = true; - * optional string a = 1; - * optional string b = 2; - * } - *} - *``` + * 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 [json_name = "required"]; */ @@ -44,19 +45,22 @@ class OneofConstraints extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type bool $required - * `required` is an optional boolean attribute that ensures that - * exactly one of the field options in a oneof is set; validation fails if - * no fields in the oneof are set. - * ```proto - * message MyMessage { - * oneof value { - * // The field `a` or `b` must be set. - * option (buf.validate.oneof).required = true; - * optional string a = 1; - * optional string b = 2; - * } - * } - * ``` + * 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; + * } + * } + * ``` * } */ public function __construct($data = NULL) { @@ -65,19 +69,22 @@ public function __construct($data = NULL) { } /** - *`required` is an optional boolean attribute that ensures that - *exactly one of the field options in a oneof is set; validation fails if - *no fields in the oneof are set. - *```proto - *message MyMessage { - * oneof value { - * // The field `a` or `b` must be set. - * option (buf.validate.oneof).required = true; - * optional string a = 1; - * optional string b = 2; - * } - *} - *``` + * 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 [json_name = "required"]; * @return bool @@ -98,19 +105,22 @@ public function clearRequired() } /** - *`required` is an optional boolean attribute that ensures that - *exactly one of the field options in a oneof is set; validation fails if - *no fields in the oneof are set. - *```proto - *message MyMessage { - * oneof value { - * // The field `a` or `b` must be set. - * option (buf.validate.oneof).required = true; - * optional string a = 1; - * optional string b = 2; - * } - *} - *``` + * 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 [json_name = "required"]; * @param bool $var diff --git a/src/Buf/Validate/RepeatedRules.php b/src/Buf/Validate/RepeatedRules.php index 4859ff5..0617de8 100644 --- a/src/Buf/Validate/RepeatedRules.php +++ b/src/Buf/Validate/RepeatedRules.php @@ -16,62 +16,63 @@ class RepeatedRules extends \Google\Protobuf\Internal\Message { /** - *`min_items` requires that this field must contain at least the specified - *minimum number of items. - *```proto - *message MyRepeated { - * // value must contain at least 2 items - * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; - *} - *``` + * `min_items` requires that this field must contain at least the specified + * minimum number of items. + * Note that `min_items = 1` is equivalent to setting a field as `required`. + * ```proto + * message MyRepeated { + * // value must contain at least 2 items + * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { */ protected $min_items = null; /** - *`max_items` denotes that this field must not exceed a - *certain number of items as the upper limit. If the field contains more - *items than specified, an error message will be generated, requiring the - *field to maintain no more than the specified number of items. - *```proto - *message MyRepeated { - * // value must contain no more than 3 item(s) - * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; - *} - *``` + * `max_items` denotes that this field must not exceed a + * certain number of items as the upper limit. If the field contains more + * items than specified, an error message will be generated, requiring the + * field to maintain no more than the specified number of items. + * ```proto + * message MyRepeated { + * // value must contain no more than 3 item(s) + * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + * } + * ``` * * Generated from protobuf field optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { */ protected $max_items = null; /** - *`unique` indicates that all elements in this field must - *be unique. This constraint is strictly applicable to scalar and enum - *types, with message types not being supported. - *```proto - *message MyRepeated { - * // repeated value must contain unique items - * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; - *} - *``` + * `unique` indicates that all elements in this field must + * be unique. This constraint is strictly applicable to scalar and enum + * types, with message types not being supported. + * ```proto + * message MyRepeated { + * // repeated value must contain unique items + * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + * } + * ``` * * Generated from protobuf field optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { */ protected $unique = null; /** - *`items` details the constraints to be applied to each item - *in the field. Even for repeated message fields, validation is executed - *against each item unless skip is explicitly specified. - *```proto - *message MyRepeated { - * // The items in the field `value` must follow the specified constraints. - * repeated string value = 1 [(buf.validate.field).repeated.items = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - *} - *``` + * `items` details the constraints to be applied to each item + * in the field. Even for repeated message fields, validation is executed + * against each item unless skip is explicitly specified. + * ```proto + * message MyRepeated { + * // The items in the field `value` must follow the specified constraints. + * repeated string value = 1 [(buf.validate.field).repeated.items = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints items = 4 [json_name = "items"]; */ @@ -84,50 +85,51 @@ class RepeatedRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $min_items - * `min_items` requires that this field must contain at least the specified - * minimum number of items. - * ```proto - * message MyRepeated { - * // value must contain at least 2 items - * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; - * } - * ``` + * `min_items` requires that this field must contain at least the specified + * minimum number of items. + * Note that `min_items = 1` is equivalent to setting a field as `required`. + * ```proto + * message MyRepeated { + * // value must contain at least 2 items + * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + * } + * ``` * @type int|string $max_items - * `max_items` denotes that this field must not exceed a - * certain number of items as the upper limit. If the field contains more - * items than specified, an error message will be generated, requiring the - * field to maintain no more than the specified number of items. - * ```proto - * message MyRepeated { - * // value must contain no more than 3 item(s) - * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; - * } - * ``` + * `max_items` denotes that this field must not exceed a + * certain number of items as the upper limit. If the field contains more + * items than specified, an error message will be generated, requiring the + * field to maintain no more than the specified number of items. + * ```proto + * message MyRepeated { + * // value must contain no more than 3 item(s) + * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + * } + * ``` * @type bool $unique - * `unique` indicates that all elements in this field must - * be unique. This constraint is strictly applicable to scalar and enum - * types, with message types not being supported. - * ```proto - * message MyRepeated { - * // repeated value must contain unique items - * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; - * } - * ``` + * `unique` indicates that all elements in this field must + * be unique. This constraint is strictly applicable to scalar and enum + * types, with message types not being supported. + * ```proto + * message MyRepeated { + * // repeated value must contain unique items + * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + * } + * ``` * @type \Buf\Validate\FieldConstraints $items - * `items` details the constraints to be applied to each item - * in the field. Even for repeated message fields, validation is executed - * against each item unless skip is explicitly specified. - * ```proto - * message MyRepeated { - * // The items in the field `value` must follow the specified constraints. - * repeated string value = 1 [(buf.validate.field).repeated.items = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - * } - * ``` + * `items` details the constraints to be applied to each item + * in the field. Even for repeated message fields, validation is executed + * against each item unless skip is explicitly specified. + * ```proto + * message MyRepeated { + * // The items in the field `value` must follow the specified constraints. + * repeated string value = 1 [(buf.validate.field).repeated.items = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -136,14 +138,15 @@ public function __construct($data = NULL) { } /** - *`min_items` requires that this field must contain at least the specified - *minimum number of items. - *```proto - *message MyRepeated { - * // value must contain at least 2 items - * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; - *} - *``` + * `min_items` requires that this field must contain at least the specified + * minimum number of items. + * Note that `min_items = 1` is equivalent to setting a field as `required`. + * ```proto + * message MyRepeated { + * // value must contain at least 2 items + * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { * @return int|string @@ -164,14 +167,15 @@ public function clearMinItems() } /** - *`min_items` requires that this field must contain at least the specified - *minimum number of items. - *```proto - *message MyRepeated { - * // value must contain at least 2 items - * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; - *} - *``` + * `min_items` requires that this field must contain at least the specified + * minimum number of items. + * Note that `min_items = 1` is equivalent to setting a field as `required`. + * ```proto + * message MyRepeated { + * // value must contain at least 2 items + * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + * } + * ``` * * Generated from protobuf field optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { * @param int|string $var @@ -186,16 +190,16 @@ public function setMinItems($var) } /** - *`max_items` denotes that this field must not exceed a - *certain number of items as the upper limit. If the field contains more - *items than specified, an error message will be generated, requiring the - *field to maintain no more than the specified number of items. - *```proto - *message MyRepeated { - * // value must contain no more than 3 item(s) - * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; - *} - *``` + * `max_items` denotes that this field must not exceed a + * certain number of items as the upper limit. If the field contains more + * items than specified, an error message will be generated, requiring the + * field to maintain no more than the specified number of items. + * ```proto + * message MyRepeated { + * // value must contain no more than 3 item(s) + * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + * } + * ``` * * Generated from protobuf field optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { * @return int|string @@ -216,16 +220,16 @@ public function clearMaxItems() } /** - *`max_items` denotes that this field must not exceed a - *certain number of items as the upper limit. If the field contains more - *items than specified, an error message will be generated, requiring the - *field to maintain no more than the specified number of items. - *```proto - *message MyRepeated { - * // value must contain no more than 3 item(s) - * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; - *} - *``` + * `max_items` denotes that this field must not exceed a + * certain number of items as the upper limit. If the field contains more + * items than specified, an error message will be generated, requiring the + * field to maintain no more than the specified number of items. + * ```proto + * message MyRepeated { + * // value must contain no more than 3 item(s) + * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + * } + * ``` * * Generated from protobuf field optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { * @param int|string $var @@ -240,15 +244,15 @@ public function setMaxItems($var) } /** - *`unique` indicates that all elements in this field must - *be unique. This constraint is strictly applicable to scalar and enum - *types, with message types not being supported. - *```proto - *message MyRepeated { - * // repeated value must contain unique items - * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; - *} - *``` + * `unique` indicates that all elements in this field must + * be unique. This constraint is strictly applicable to scalar and enum + * types, with message types not being supported. + * ```proto + * message MyRepeated { + * // repeated value must contain unique items + * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + * } + * ``` * * Generated from protobuf field optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { * @return bool @@ -269,15 +273,15 @@ public function clearUnique() } /** - *`unique` indicates that all elements in this field must - *be unique. This constraint is strictly applicable to scalar and enum - *types, with message types not being supported. - *```proto - *message MyRepeated { - * // repeated value must contain unique items - * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; - *} - *``` + * `unique` indicates that all elements in this field must + * be unique. This constraint is strictly applicable to scalar and enum + * types, with message types not being supported. + * ```proto + * message MyRepeated { + * // repeated value must contain unique items + * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + * } + * ``` * * Generated from protobuf field optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { * @param bool $var @@ -292,20 +296,20 @@ public function setUnique($var) } /** - *`items` details the constraints to be applied to each item - *in the field. Even for repeated message fields, validation is executed - *against each item unless skip is explicitly specified. - *```proto - *message MyRepeated { - * // The items in the field `value` must follow the specified constraints. - * repeated string value = 1 [(buf.validate.field).repeated.items = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - *} - *``` + * `items` details the constraints to be applied to each item + * in the field. Even for repeated message fields, validation is executed + * against each item unless skip is explicitly specified. + * ```proto + * message MyRepeated { + * // The items in the field `value` must follow the specified constraints. + * repeated string value = 1 [(buf.validate.field).repeated.items = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints items = 4 [json_name = "items"]; * @return \Buf\Validate\FieldConstraints|null @@ -326,20 +330,20 @@ public function clearItems() } /** - *`items` details the constraints to be applied to each item - *in the field. Even for repeated message fields, validation is executed - *against each item unless skip is explicitly specified. - *```proto - *message MyRepeated { - * // The items in the field `value` must follow the specified constraints. - * repeated string value = 1 [(buf.validate.field).repeated.items = { - * string: { - * min_len: 3 - * max_len: 10 - * } - * }]; - *} - *``` + * `items` details the constraints to be applied to each item + * in the field. Even for repeated message fields, validation is executed + * against each item unless skip is explicitly specified. + * ```proto + * message MyRepeated { + * // The items in the field `value` must follow the specified constraints. + * repeated string value = 1 [(buf.validate.field).repeated.items = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` * * Generated from protobuf field optional .buf.validate.FieldConstraints items = 4 [json_name = "items"]; * @param \Buf\Validate\FieldConstraints $var diff --git a/src/Buf/Validate/SFixed32Rules.php b/src/Buf/Validate/SFixed32Rules.php index 4ed555d..3c8ade6 100644 --- a/src/Buf/Validate/SFixed32Rules.php +++ b/src/Buf/Validate/SFixed32Rules.php @@ -16,42 +16,42 @@ class SFixed32Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySFixed32 { - * // value must equal 42 + * ```proto + * message MySFixed32 { + * // value must equal 42 * sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySFixed32 { - * // value must be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed32 { - * // value must not be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must not be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -66,86 +66,86 @@ class SFixed32Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $const - * `const` requires the field value to exactly match the specified value. If + * `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 MySFixed32 { - * // value must equal 42 + * ```proto + * message MySFixed32 { + * // value must equal 42 * sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; - * } - * ``` + * } + * ``` * @type int $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 MySFixed32 { - * // value must be less than 10 + * ```proto + * message MySFixed32 { + * // value must be less than 10 * sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; - * } - * ``` + * } + * ``` * @type int $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 MySFixed32 { - * // value must be less than or equal to 10 + * ```proto + * message MySFixed32 { + * // value must be less than or equal to 10 * sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; - * } - * ``` + * } + * ``` * @type int $gt - * `gt` requires the field value to be greater than the specified value + * `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 MySFixed32 { - * // value must be greater than 5 [sfixed32.gt] - * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; - * // value must be greater than 5 and less than 10 [sfixed32.gt_lt] - * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] - * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySFixed32 { + * // value must be greater than 5 [sfixed32.gt] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + * // value must be greater than 5 and less than 10 [sfixed32.gt_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + * } + * ``` * @type int $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 MySFixed32 { - * // value must be greater than or equal to 5 [sfixed32.gte] - * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] - * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] - * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySFixed32 { + * // value must be greater than or equal to 5 [sfixed32.gte] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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 MySFixed32 { - * // value must be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySFixed32 { + * // value must be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed32 { - * // value must not be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySFixed32 { + * // value must not be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -154,14 +154,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySFixed32 { - * // value must equal 42 + * ```proto + * message MySFixed32 { + * // value must equal 42 * sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int @@ -182,14 +182,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySFixed32 { - * // value must equal 42 + * ```proto + * message MySFixed32 { + * // value must equal 42 * sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int $var @@ -204,15 +204,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MySFixed32 { - * // value must be less than 10 + * ```proto + * message MySFixed32 { + * // value must be less than 10 * sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @return int @@ -228,15 +228,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MySFixed32 { - * // value must be less than 10 + * ```proto + * message MySFixed32 { + * // value must be less than 10 * sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @param int $var @@ -251,15 +251,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MySFixed32 { - * // value must be less than or equal to 10 + * ```proto + * message MySFixed32 { + * // value must be less than or equal to 10 * sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @return int @@ -275,15 +275,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MySFixed32 { - * // value must be less than or equal to 10 + * ```proto + * message MySFixed32 { + * // value must be less than or equal to 10 * sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @param int $var @@ -298,21 +298,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySFixed32 { - * // value must be greater than 5 [sfixed32.gt] - * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; - * // value must be greater than 5 and less than 10 [sfixed32.gt_lt] - * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] - * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be greater than 5 [sfixed32.gt] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + * // value must be greater than 5 and less than 10 [sfixed32.gt_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @return int @@ -328,21 +328,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySFixed32 { - * // value must be greater than 5 [sfixed32.gt] - * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; - * // value must be greater than 5 and less than 10 [sfixed32.gt_lt] - * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] - * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be greater than 5 [sfixed32.gt] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + * // value must be greater than 5 and less than 10 [sfixed32.gt_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @param int $var @@ -357,21 +357,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySFixed32 { - * // value must be greater than or equal to 5 [sfixed32.gte] - * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] - * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] - * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be greater than or equal to 5 [sfixed32.gte] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @return int @@ -387,21 +387,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySFixed32 { - * // value must be greater than or equal to 5 [sfixed32.gte] - * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] - * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] - * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be greater than or equal to 5 [sfixed32.gte] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @param int $var @@ -416,15 +416,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySFixed32 { - * // value must be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -435,15 +435,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySFixed32 { - * // value must be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -458,15 +458,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed32 { - * // value must not be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must not be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -477,15 +477,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed32 { - * // value must not be in list [1, 2, 3] - * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed32 { + * // value must not be in list [1, 2, 3] + * repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/SFixed64Rules.php b/src/Buf/Validate/SFixed64Rules.php index 40ca99b..7a03ee7 100644 --- a/src/Buf/Validate/SFixed64Rules.php +++ b/src/Buf/Validate/SFixed64Rules.php @@ -16,42 +16,42 @@ class SFixed64Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySFixed64 { - * // value must equal 42 + * ```proto + * message MySFixed64 { + * // value must equal 42 * sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySFixed64 { - * // value must be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed64 { - * // value must not be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must not be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -66,86 +66,86 @@ class SFixed64Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $const - * `const` requires the field value to exactly match the specified value. If + * `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 MySFixed64 { - * // value must equal 42 + * ```proto + * message MySFixed64 { + * // value must equal 42 * sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; - * } - * ``` + * } + * ``` * @type int|string $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 MySFixed64 { - * // value must be less than 10 + * ```proto + * message MySFixed64 { + * // value must be less than 10 * sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; - * } - * ``` + * } + * ``` * @type int|string $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 MySFixed64 { - * // value must be less than or equal to 10 + * ```proto + * message MySFixed64 { + * // value must be less than or equal to 10 * sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; - * } - * ``` + * } + * ``` * @type int|string $gt - * `gt` requires the field value to be greater than the specified value + * `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 MySFixed64 { - * // value must be greater than 5 [sfixed64.gt] - * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; - * // value must be greater than 5 and less than 10 [sfixed64.gt_lt] - * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] - * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySFixed64 { + * // value must be greater than 5 [sfixed64.gt] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + * // value must be greater than 5 and less than 10 [sfixed64.gt_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + * } + * ``` * @type int|string $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 MySFixed64 { - * // value must be greater than or equal to 5 [sfixed64.gte] - * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] - * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] - * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySFixed64 { + * // value must be greater than or equal to 5 [sfixed64.gte] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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 MySFixed64 { - * // value must be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySFixed64 { + * // value must be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed64 { - * // value must not be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySFixed64 { + * // value must not be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -154,14 +154,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySFixed64 { - * // value must equal 42 + * ```proto + * message MySFixed64 { + * // value must equal 42 * sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int|string @@ -182,14 +182,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySFixed64 { - * // value must equal 42 + * ```proto + * message MySFixed64 { + * // value must equal 42 * sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int|string $var @@ -204,15 +204,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MySFixed64 { - * // value must be less than 10 + * ```proto + * message MySFixed64 { + * // value must be less than 10 * sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @return int|string @@ -228,15 +228,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 MySFixed64 { - * // value must be less than 10 + * ```proto + * message MySFixed64 { + * // value must be less than 10 * sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @param int|string $var @@ -251,15 +251,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MySFixed64 { - * // value must be less than or equal to 10 + * ```proto + * message MySFixed64 { + * // value must be less than or equal to 10 * sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @return int|string @@ -275,15 +275,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MySFixed64 { - * // value must be less than or equal to 10 + * ```proto + * message MySFixed64 { + * // value must be less than or equal to 10 * sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @param int|string $var @@ -298,21 +298,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySFixed64 { - * // value must be greater than 5 [sfixed64.gt] - * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; - * // value must be greater than 5 and less than 10 [sfixed64.gt_lt] - * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] - * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be greater than 5 [sfixed64.gt] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + * // value must be greater than 5 and less than 10 [sfixed64.gt_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @return int|string @@ -328,21 +328,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySFixed64 { - * // value must be greater than 5 [sfixed64.gt] - * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; - * // value must be greater than 5 and less than 10 [sfixed64.gt_lt] - * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] - * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be greater than 5 [sfixed64.gt] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + * // value must be greater than 5 and less than 10 [sfixed64.gt_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @param int|string $var @@ -357,21 +357,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySFixed64 { - * // value must be greater than or equal to 5 [sfixed64.gte] - * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] - * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] - * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be greater than or equal to 5 [sfixed64.gte] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @return int|string @@ -387,21 +387,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySFixed64 { - * // value must be greater than or equal to 5 [sfixed64.gte] - * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] - * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] - * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be greater than or equal to 5 [sfixed64.gte] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @param int|string $var @@ -416,15 +416,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySFixed64 { - * // value must be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -435,15 +435,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySFixed64 { - * // value must be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var @@ -458,15 +458,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed64 { - * // value must not be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must not be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -477,15 +477,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySFixed64 { - * // value must not be in list [1, 2, 3] - * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySFixed64 { + * // value must not be in list [1, 2, 3] + * repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/SInt32Rules.php b/src/Buf/Validate/SInt32Rules.php index f77a08a..32303ba 100644 --- a/src/Buf/Validate/SInt32Rules.php +++ b/src/Buf/Validate/SInt32Rules.php @@ -16,42 +16,42 @@ class SInt32Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MySInt32 { + * // value must equal 42 * sint32 value = 1 [(buf.validate.field).sint32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySInt32 { - * // value must be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt32 { + * // value must be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySInt32 { - * // value must not be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt32 { + * // value must not be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -66,86 +66,86 @@ class SInt32Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MySInt32 { + * // value must equal 42 * sint32 value = 1 [(buf.validate.field).sint32.const = 42]; - * } - * ``` + * } + * ``` * @type int $lt - * `lt` requires the field value to be less than the specified value (field + * `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 + * ```proto + * message MySInt32 { + * // value must be less than 10 * sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; - * } - * ``` + * } + * ``` * @type int $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 + * ```proto + * message MySInt32 { + * // value must be less than or equal to 10 * sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; - * } - * ``` + * } + * ``` * @type int $gt - * `gt` requires the field value to be greater than the specified value + * `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 MySInt32 { - * // value must be greater than 5 [sint32.gt] - * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; - * // value must be greater than 5 and less than 10 [sint32.gt_lt] - * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] - * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySInt32 { + * // value must be greater than 5 [sint32.gt] + * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + * // value must be greater than 5 and less than 10 [sint32.gt_lt] + * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + * } + * ``` * @type int $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 MySInt32 { + * ```proto + * message MySInt32 { * // value must be greater than or equal to 5 [sint32.gte] * sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; * // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt] * sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; * // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] * sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; - * } - * ``` + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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 MySInt32 { - * // value must be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySInt32 { + * // value must be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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 MySInt32 { - * // value must not be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySInt32 { + * // value must not be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -154,14 +154,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MySInt32 { + * // value must equal 42 * sint32 value = 1 [(buf.validate.field).sint32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int @@ -182,14 +182,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MySInt32 { + * // value must equal 42 * sint32 value = 1 [(buf.validate.field).sint32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int $var @@ -204,15 +204,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return int @@ -228,15 +228,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param int $var @@ -251,15 +251,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return int @@ -275,15 +275,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param int $var @@ -298,21 +298,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySInt32 { - * // value must be greater than 5 [sint32.gt] - * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; - * // value must be greater than 5 and less than 10 [sint32.gt_lt] - * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] - * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySInt32 { + * // value must be greater than 5 [sint32.gt] + * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + * // value must be greater than 5 and less than 10 [sint32.gt_lt] + * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @return int @@ -328,21 +328,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySInt32 { - * // value must be greater than 5 [sint32.gt] - * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; - * // value must be greater than 5 and less than 10 [sint32.gt_lt] - * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] - * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySInt32 { + * // value must be greater than 5 [sint32.gt] + * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + * // value must be greater than 5 and less than 10 [sint32.gt_lt] + * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @param int $var @@ -357,21 +357,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySInt32 { + * ```proto + * message MySInt32 { * // value must be greater than or equal to 5 [sint32.gte] * sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; * // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt] * sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; * // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] * sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; - *} - *``` + * } + * ``` * * Generated from protobuf field sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @return int @@ -387,21 +387,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySInt32 { + * ```proto + * message MySInt32 { * // value must be greater than or equal to 5 [sint32.gte] * sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; * // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt] * sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; * // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] * sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; - *} - *``` + * } + * ``` * * Generated from protobuf field sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @param int $var @@ -416,15 +416,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySInt32 { - * // value must be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt32 { + * // value must be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -435,15 +435,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySInt32 { - * // value must be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt32 { + * // value must be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -458,15 +458,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySInt32 { - * // value must not be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt32 { + * // value must not be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -477,15 +477,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySInt32 { - * // value must not be in list [1, 2, 3] - * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt32 { + * // value must not be in list [1, 2, 3] + * repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/SInt64Rules.php b/src/Buf/Validate/SInt64Rules.php index cf9ff23..0678802 100644 --- a/src/Buf/Validate/SInt64Rules.php +++ b/src/Buf/Validate/SInt64Rules.php @@ -16,42 +16,42 @@ class SInt64Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySInt64 { - * // value must equal 42 + * ```proto + * message MySInt64 { + * // value must equal 42 * sint64 value = 1 [(buf.validate.field).sint64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySInt64 { - * // value must be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySInt64 { - * // value must not be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt64 { + * // value must not be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -66,86 +66,86 @@ class SInt64Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $const - * `const` requires the field value to exactly match the specified value. If + * `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 MySInt64 { - * // value must equal 42 + * ```proto + * message MySInt64 { + * // value must equal 42 * sint64 value = 1 [(buf.validate.field).sint64.const = 42]; - * } - * ``` + * } + * ``` * @type int|string $lt - * `lt` requires the field value to be less than the specified value (field + * `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 MySInt64 { - * // value must be less than 10 + * ```proto + * message MySInt64 { + * // value must be less than 10 * sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; - * } - * ``` + * } + * ``` * @type int|string $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 MySInt64 { - * // value must be less than or equal to 10 + * ```proto + * message MySInt64 { + * // value must be less than or equal to 10 * sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; - * } - * ``` + * } + * ``` * @type int|string $gt - * `gt` requires the field value to be greater than the specified value + * `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 MySInt64 { - * // value must be greater than 5 [sint64.gt] - * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; - * // value must be greater than 5 and less than 10 [sint64.gt_lt] - * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] - * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySInt64 { + * // value must be greater than 5 [sint64.gt] + * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + * // value must be greater than 5 and less than 10 [sint64.gt_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + * } + * ``` * @type int|string $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 MySInt64 { - * // value must be greater than or equal to 5 [sint64.gte] - * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] - * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] - * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; - * } - * ``` + * ```proto + * message MySInt64 { + * // value must be greater than or equal to 5 [sint64.gte] + * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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 MySInt64 { - * // value must be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySInt64 { + * // value must be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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 MySInt64 { - * // value must not be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MySInt64 { + * // value must not be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -154,14 +154,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySInt64 { - * // value must equal 42 + * ```proto + * message MySInt64 { + * // value must equal 42 * sint64 value = 1 [(buf.validate.field).sint64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int|string @@ -182,14 +182,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 MySInt64 { - * // value must equal 42 + * ```proto + * message MySInt64 { + * // value must equal 42 * sint64 value = 1 [(buf.validate.field).sint64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int|string $var @@ -204,15 +204,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field + * `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 MySInt64 { - * // value must be less than 10 + * ```proto + * message MySInt64 { + * // value must be less than 10 * sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @return int|string @@ -228,15 +228,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field + * `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 MySInt64 { - * // value must be less than 10 + * ```proto + * message MySInt64 { + * // value must be less than 10 * sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { * @param int|string $var @@ -251,15 +251,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MySInt64 { - * // value must be less than or equal to 10 + * ```proto + * message MySInt64 { + * // value must be less than or equal to 10 * sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @return int|string @@ -275,15 +275,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 MySInt64 { - * // value must be less than or equal to 10 + * ```proto + * message MySInt64 { + * // value must be less than or equal to 10 * sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { * @param int|string $var @@ -298,21 +298,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySInt64 { - * // value must be greater than 5 [sint64.gt] - * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; - * // value must be greater than 5 and less than 10 [sint64.gt_lt] - * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] - * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be greater than 5 [sint64.gt] + * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + * // value must be greater than 5 and less than 10 [sint64.gt_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @return int|string @@ -328,21 +328,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 MySInt64 { - * // value must be greater than 5 [sint64.gt] - * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; - * // value must be greater than 5 and less than 10 [sint64.gt_lt] - * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; - * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] - * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be greater than 5 [sint64.gt] + * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + * // value must be greater than 5 and less than 10 [sint64.gt_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { * @param int|string $var @@ -357,21 +357,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySInt64 { - * // value must be greater than or equal to 5 [sint64.gte] - * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] - * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] - * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be greater than or equal to 5 [sint64.gte] + * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @return int|string @@ -387,21 +387,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 MySInt64 { - * // value must be greater than or equal to 5 [sint64.gte] - * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; - * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] - * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; - * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] - * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be greater than or equal to 5 [sint64.gte] + * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + * } + * ``` * * Generated from protobuf field sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { * @param int|string $var @@ -416,15 +416,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySInt64 { - * // value must be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -435,15 +435,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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 MySInt64 { - * // value must be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt64 { + * // value must be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var @@ -458,15 +458,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySInt64 { - * // value must not be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt64 { + * // value must not be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -477,15 +477,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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 MySInt64 { - * // value must not be in list [1, 2, 3] - * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MySInt64 { + * // value must not be in list [1, 2, 3] + * repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/StringRules.php b/src/Buf/Validate/StringRules.php index da1e6ab..7934187 100644 --- a/src/Buf/Validate/StringRules.php +++ b/src/Buf/Validate/StringRules.php @@ -17,217 +17,217 @@ class StringRules extends \Google\Protobuf\Internal\Message { /** - *`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 MyString { - * // value must equal `hello` + * `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 MyString { + * // value must equal `hello` * string value = 1 [(buf.validate.field).string.const = "hello"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`len` dictates that the field value must have the specified - *number of characters (Unicode code points), which may differ from the number - *of bytes in the string. If the field value does not meet the specified - *length, an error message will be generated. - *```proto - *message MyString { - * // value length must be 5 characters + * `len` dictates that the field value must have the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value does not meet the specified + * length, an error message will be generated. + * ```proto + * message MyString { + * // value length must be 5 characters * string value = 1 [(buf.validate.field).string.len = 5]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { */ protected $len = null; /** - *`min_len` specifies that the field value must have at least the specified - *number of characters (Unicode code points), which may differ from the number - *of bytes in the string. If the field value contains fewer characters, an error - *message will be generated. - *```proto - *message MyString { - * // value length must be at least 3 characters + * `min_len` specifies that the field value must have at least the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value contains fewer characters, an error + * message will be generated. + * ```proto + * message MyString { + * // value length must be at least 3 characters * string value = 1 [(buf.validate.field).string.min_len = 3]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { */ protected $min_len = null; /** - *`max_len` specifies that the field value must have no more than the specified - *number of characters (Unicode code points), which may differ from the - *number of bytes in the string. If the field value contains more characters, - *an error message will be generated. - *```proto - *message MyString { - * // value length must be at most 10 characters + * `max_len` specifies that the field value must have no more than the specified + * number of characters (Unicode code points), which may differ from the + * number of bytes in the string. If the field value contains more characters, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 10 characters * string value = 1 [(buf.validate.field).string.max_len = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { */ protected $max_len = null; /** - *`len_bytes` dictates that the field value must have the specified number of - *bytes. If the field value does not match the specified length in bytes, - *an error message will be generated. - *```proto - *message MyString { - * // value length must be 6 bytes + * `len_bytes` dictates that the field value must have the specified number of + * bytes. If the field value does not match the specified length in bytes, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be 6 bytes * string value = 1 [(buf.validate.field).string.len_bytes = 6]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { */ protected $len_bytes = null; /** - *`min_bytes` specifies that the field value must have at least the specified - *number of bytes. If the field value contains fewer bytes, an error message - *will be generated. - *```proto - *message MyString { - * // value length must be at least 4 bytes + * `min_bytes` specifies that the field value must have at least the specified + * number of bytes. If the field value contains fewer bytes, an error message + * will be generated. + * ```proto + * message MyString { + * // value length must be at least 4 bytes * string value = 1 [(buf.validate.field).string.min_bytes = 4]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { */ protected $min_bytes = null; /** - *`max_bytes` specifies that the field value must have no more than the + * `max_bytes` specifies that the field value must have no more than the *specified number of bytes. If the field value contains more bytes, an - *error message will be generated. - *```proto - *message MyString { - * // value length must be at most 8 bytes + * error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 8 bytes * string value = 1 [(buf.validate.field).string.max_bytes = 8]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { */ protected $max_bytes = null; /** - *`pattern` specifies that the field value must match the specified - *regular expression (RE2 syntax), with the expression provided without any - *delimiters. If the field value doesn't match the regular expression, an - *error message will be generated. - *```proto - *message MyString { - * // value does not match regex pattern `^[a-zA-Z]//$` + * `pattern` specifies that the field value must match the specified + * regular expression (RE2 syntax), with the expression provided without any + * delimiters. If the field value doesn't match the regular expression, an + * error message will be generated. + * ```proto + * message MyString { + * // value does not match regex pattern `^[a-zA-Z]//$` * string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { */ protected $pattern = null; /** - *`prefix` specifies that the field value must have the + * `prefix` specifies that the field value must have the *specified substring at the beginning of the string. If the field value - *doesn't start with the specified prefix, an error message will be - *generated. - *```proto - *message MyString { - * // value does not have prefix `pre` + * doesn't start with the specified prefix, an error message will be + * generated. + * ```proto + * message MyString { + * // value does not have prefix `pre` * string value = 1 [(buf.validate.field).string.prefix = "pre"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { */ protected $prefix = null; /** - *`suffix` specifies that the field value must have the + * `suffix` specifies that the field value must have the *specified substring at the end of the string. If the field value doesn't - *end with the specified suffix, an error message will be generated. - *```proto - *message MyString { - * // value does not have suffix `post` + * end with the specified suffix, an error message will be generated. + * ```proto + * message MyString { + * // value does not have suffix `post` * string value = 1 [(buf.validate.field).string.suffix = "post"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { */ protected $suffix = null; /** - *`contains` specifies that the field value must have the + * `contains` specifies that the field value must have the *specified substring anywhere in the string. If the field value doesn't - *contain the specified substring, an error message will be generated. - *```proto - *message MyString { - * // value does not contain substring `inside`. + * contain the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value does not contain substring `inside`. * string value = 1 [(buf.validate.field).string.contains = "inside"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { */ protected $contains = null; /** - *`not_contains` specifies that the field value must not have the + * `not_contains` specifies that the field value must not have the *specified substring anywhere in the string. If the field value contains - *the specified substring, an error message will be generated. - *```proto - *message MyString { - * // value contains substring `inside`. + * the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value contains substring `inside`. * string value = 1 [(buf.validate.field).string.not_contains = "inside"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { */ protected $not_contains = null; /** - *`in` specifies that the field value must be equal to one of the specified - *values. If the field value isn't one of the specified values, an error - *message will be generated. - *```proto - *message MyString { - * // value must be in list ["apple", "banana"] - * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; - *} - *``` + * `in` specifies that the field value must be equal to one of the specified + * values. If the field value isn't one of the specified values, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be in list ["apple", "banana"] + * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + * } + * ``` * * Generated from protobuf field repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` specifies that the field value cannot be equal to any - *of the specified values. If the field value is one of the specified values, - *an error message will be generated. - *```proto - *message MyString { - * // value must not be in list ["orange", "grape"] - * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; - *} - *``` + * `not_in` specifies that the field value cannot be equal to any + * of the specified values. If the field value is one of the specified values, + * an error message will be generated. + * ```proto + * message MyString { + * // value must not be in list ["orange", "grape"] + * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + * } + * ``` * * Generated from protobuf field repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { */ private $not_in; /** - *This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to - *enable strict header validation. By default, this is true, and HTTP header - *validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser - *validations that only disallow `\r\n\0` characters, which can be used to - *bypass header matching rules. - *```proto - *message MyString { + * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + * enable strict header validation. By default, this is true, and HTTP header + * validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser + * validations that only disallow `\r\n\0` characters, which can be used to + * bypass header matching rules. + * ```proto + * message MyString { * // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. * string value = 1 [(buf.validate.field).string.strict = false]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool strict = 25 [json_name = "strict"]; */ @@ -241,272 +241,337 @@ class StringRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $const - * `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 MyString { - * // value must equal `hello` + * `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 MyString { + * // value must equal `hello` * string value = 1 [(buf.validate.field).string.const = "hello"]; - * } - * ``` + * } + * ``` * @type int|string $len - * `len` dictates that the field value must have the specified - * number of characters (Unicode code points), which may differ from the number - * of bytes in the string. If the field value does not meet the specified - * length, an error message will be generated. - * ```proto - * message MyString { - * // value length must be 5 characters + * `len` dictates that the field value must have the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value does not meet the specified + * length, an error message will be generated. + * ```proto + * message MyString { + * // value length must be 5 characters * string value = 1 [(buf.validate.field).string.len = 5]; - * } - * ``` + * } + * ``` * @type int|string $min_len - * `min_len` specifies that the field value must have at least the specified - * number of characters (Unicode code points), which may differ from the number - * of bytes in the string. If the field value contains fewer characters, an error - * message will be generated. - * ```proto - * message MyString { - * // value length must be at least 3 characters + * `min_len` specifies that the field value must have at least the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value contains fewer characters, an error + * message will be generated. + * ```proto + * message MyString { + * // value length must be at least 3 characters * string value = 1 [(buf.validate.field).string.min_len = 3]; - * } - * ``` + * } + * ``` * @type int|string $max_len - * `max_len` specifies that the field value must have no more than the specified - * number of characters (Unicode code points), which may differ from the - * number of bytes in the string. If the field value contains more characters, - * an error message will be generated. - * ```proto - * message MyString { - * // value length must be at most 10 characters + * `max_len` specifies that the field value must have no more than the specified + * number of characters (Unicode code points), which may differ from the + * number of bytes in the string. If the field value contains more characters, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 10 characters * string value = 1 [(buf.validate.field).string.max_len = 10]; - * } - * ``` + * } + * ``` * @type int|string $len_bytes - * `len_bytes` dictates that the field value must have the specified number of - * bytes. If the field value does not match the specified length in bytes, - * an error message will be generated. - * ```proto - * message MyString { - * // value length must be 6 bytes + * `len_bytes` dictates that the field value must have the specified number of + * bytes. If the field value does not match the specified length in bytes, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be 6 bytes * string value = 1 [(buf.validate.field).string.len_bytes = 6]; - * } - * ``` + * } + * ``` * @type int|string $min_bytes - * `min_bytes` specifies that the field value must have at least the specified - * number of bytes. If the field value contains fewer bytes, an error message - * will be generated. - * ```proto - * message MyString { - * // value length must be at least 4 bytes + * `min_bytes` specifies that the field value must have at least the specified + * number of bytes. If the field value contains fewer bytes, an error message + * will be generated. + * ```proto + * message MyString { + * // value length must be at least 4 bytes * string value = 1 [(buf.validate.field).string.min_bytes = 4]; - * } - * ``` + * } + * ``` * @type int|string $max_bytes - * `max_bytes` specifies that the field value must have no more than the + * `max_bytes` specifies that the field value must have no more than the * specified number of bytes. If the field value contains more bytes, an - * error message will be generated. - * ```proto - * message MyString { - * // value length must be at most 8 bytes + * error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 8 bytes * string value = 1 [(buf.validate.field).string.max_bytes = 8]; - * } - * ``` + * } + * ``` * @type string $pattern - * `pattern` specifies that the field value must match the specified - * regular expression (RE2 syntax), with the expression provided without any - * delimiters. If the field value doesn't match the regular expression, an - * error message will be generated. - * ```proto - * message MyString { - * // value does not match regex pattern `^[a-zA-Z]//$` + * `pattern` specifies that the field value must match the specified + * regular expression (RE2 syntax), with the expression provided without any + * delimiters. If the field value doesn't match the regular expression, an + * error message will be generated. + * ```proto + * message MyString { + * // value does not match regex pattern `^[a-zA-Z]//$` * string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; - * } - * ``` + * } + * ``` * @type string $prefix - * `prefix` specifies that the field value must have the + * `prefix` specifies that the field value must have the * specified substring at the beginning of the string. If the field value - * doesn't start with the specified prefix, an error message will be - * generated. - * ```proto - * message MyString { - * // value does not have prefix `pre` + * doesn't start with the specified prefix, an error message will be + * generated. + * ```proto + * message MyString { + * // value does not have prefix `pre` * string value = 1 [(buf.validate.field).string.prefix = "pre"]; - * } - * ``` + * } + * ``` * @type string $suffix - * `suffix` specifies that the field value must have the + * `suffix` specifies that the field value must have the * specified substring at the end of the string. If the field value doesn't - * end with the specified suffix, an error message will be generated. - * ```proto - * message MyString { - * // value does not have suffix `post` + * end with the specified suffix, an error message will be generated. + * ```proto + * message MyString { + * // value does not have suffix `post` * string value = 1 [(buf.validate.field).string.suffix = "post"]; - * } - * ``` + * } + * ``` * @type string $contains - * `contains` specifies that the field value must have the + * `contains` specifies that the field value must have the * specified substring anywhere in the string. If the field value doesn't - * contain the specified substring, an error message will be generated. - * ```proto - * message MyString { - * // value does not contain substring `inside`. + * contain the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value does not contain substring `inside`. * string value = 1 [(buf.validate.field).string.contains = "inside"]; - * } - * ``` + * } + * ``` * @type string $not_contains - * `not_contains` specifies that the field value must not have the + * `not_contains` specifies that the field value must not have the * specified substring anywhere in the string. If the field value contains - * the specified substring, an error message will be generated. - * ```proto - * message MyString { - * // value contains substring `inside`. + * the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value contains substring `inside`. * string value = 1 [(buf.validate.field).string.not_contains = "inside"]; - * } - * ``` + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` specifies that the field value must be equal to one of the specified - * values. If the field value isn't one of the specified values, an error - * message will be generated. - * ```proto - * message MyString { - * // value must be in list ["apple", "banana"] - * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; - * } - * ``` + * `in` specifies that the field value must be equal to one of the specified + * values. If the field value isn't one of the specified values, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be in list ["apple", "banana"] + * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` specifies that the field value cannot be equal to any - * of the specified values. If the field value is one of the specified values, - * an error message will be generated. - * ```proto - * message MyString { - * // value must not be in list ["orange", "grape"] - * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; - * } - * ``` + * `not_in` specifies that the field value cannot be equal to any + * of the specified values. If the field value is one of the specified values, + * an error message will be generated. + * ```proto + * message MyString { + * // value must not be in list ["orange", "grape"] + * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + * } + * ``` * @type bool $email - * `email` specifies that the field value must be a valid email address - * (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). - * If the field value isn't a valid email address, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid email address + * `email` specifies that the field value must be a valid email address + * (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). + * If the field value isn't a valid email address, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid email address * string value = 1 [(buf.validate.field).string.email = true]; - * } - * ``` + * } + * ``` * @type bool $hostname - * `hostname` specifies that the field value must be a valid - * hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support - * internationalized domain names (IDNs). If the field value isn't a - * valid hostname, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid hostname + * `hostname` specifies that the field value must be a valid + * hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support + * internationalized domain names (IDNs). If the field value isn't a + * valid hostname, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid hostname * string value = 1 [(buf.validate.field).string.hostname = true]; - * } - * ``` + * } + * ``` * @type bool $ip - * `ip` specifies that the field value must be a valid IP - * (v4 or v6) address, without surrounding square brackets for IPv6 addresses. - * If the field value isn't a valid IP address, an error message will be - * generated. - * ```proto - * message MyString { - * // value must be a valid IP address + * `ip` specifies that the field value must be a valid IP + * (v4 or v6) address, without surrounding square brackets for IPv6 addresses. + * If the field value isn't a valid IP address, an error message will be + * generated. + * ```proto + * message MyString { + * // value must be a valid IP address * string value = 1 [(buf.validate.field).string.ip = true]; - * } - * ``` + * } + * ``` * @type bool $ipv4 - * `ipv4` specifies that the field value must be a valid IPv4 - * address. If the field value isn't a valid IPv4 address, an error message - * will be generated. - * ```proto - * message MyString { - * // value must be a valid IPv4 address + * `ipv4` specifies that the field value must be a valid IPv4 + * address. If the field value isn't a valid IPv4 address, an error message + * will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv4 address * string value = 1 [(buf.validate.field).string.ipv4 = true]; - * } - * ``` + * } + * ``` * @type bool $ipv6 - * `ipv6` specifies that the field value must be a valid - * IPv6 address, without surrounding square brackets. If the field value is - * not a valid IPv6 address, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid IPv6 address + * `ipv6` specifies that the field value must be a valid + * IPv6 address, without surrounding square brackets. If the field value is + * not a valid IPv6 address, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv6 address * string value = 1 [(buf.validate.field).string.ipv6 = true]; - * } - * ``` + * } + * ``` * @type bool $uri - * `uri` specifies that the field value must be a valid, - * absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, - * absolute URI, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid URI + * `uri` specifies that the field value must be a valid, + * absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, + * absolute URI, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid URI * string value = 1 [(buf.validate.field).string.uri = true]; - * } - * ``` + * } + * ``` * @type bool $uri_ref - * `uri_ref` specifies that the field value must be a valid URI - * as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the - * field value isn't a valid URI, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid URI + * `uri_ref` specifies that the field value must be a valid URI + * as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the + * field value isn't a valid URI, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid URI * string value = 1 [(buf.validate.field).string.uri_ref = true]; - * } - * ``` + * } + * ``` * @type bool $address - * `address` specifies that the field value must be either a valid hostname - * as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) - * (which doesn't support internationalized domain names or IDNs) or a valid - * IP (v4 or v6). If the field value isn't a valid hostname or IP, an error - * message will be generated. - * ```proto - * message MyString { - * // value must be a valid hostname, or ip address + * `address` specifies that the field value must be either a valid hostname + * as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) + * (which doesn't support internationalized domain names or IDNs) or a valid + * IP (v4 or v6). If the field value isn't a valid hostname or IP, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be a valid hostname, or ip address * string value = 1 [(buf.validate.field).string.address = true]; - * } - * ``` + * } + * ``` * @type bool $uuid - * `uuid` specifies that the field value must be a valid UUID as defined by - * [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the - * field value isn't a valid UUID, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid UUID + * `uuid` specifies that the field value must be a valid UUID as defined by + * [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the + * field value isn't a valid UUID, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid UUID * string value = 1 [(buf.validate.field).string.uuid = true]; - * } - * ``` + * } + * ``` + * @type bool $ip_with_prefixlen + * `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) + * address with prefix length. If the field value isn't a valid IP with prefix + * length, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IP with prefix length + * string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + * } + * ``` + * @type bool $ipv4_with_prefixlen + * `ipv4_with_prefixlen` specifies that the field value must be a valid + * IPv4 address with prefix. + * If the field value isn't a valid IPv4 address with prefix length, + * an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv4 address with prefix lentgh + * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + * } + * ``` + * @type bool $ipv6_with_prefixlen + * `ipv6_with_prefixlen` specifies that the field value must be a valid + * IPv6 address with prefix length. + * If the field value is not a valid IPv6 address with prefix length, + * an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv6 address prefix length + * string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + * } + * ``` + * @type bool $ip_prefix + * `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. + * If the field value isn't a valid IP prefix, an error message will be + * generated. The prefix must have all zeros for the masked bits of the prefix (e.g., + * `127.0.0.0/16`, not `127.0.0.1/16`). + * ```proto + * message MyString { + * // value must be a valid IP prefix + * string value = 1 [(buf.validate.field).string.ip_prefix = true]; + * } + * ``` + * @type bool $ipv4_prefix + * `ipv4_prefix` specifies that the field value must be a valid IPv4 + * prefix. If the field value isn't a valid IPv4 prefix, an error message + * will be generated. The prefix must have all zeros for the masked bits of + * the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). + * ```proto + * message MyString { + * // value must be a valid IPv4 prefix + * string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + * } + * ``` + * @type bool $ipv6_prefix + * `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. + * If the field value is not a valid IPv6 prefix, an error message will be + * generated. The prefix must have all zeros for the masked bits of the prefix + * (e.g., `2001:db8::/48`, not `2001:db8::1/48`). + * ```proto + * message MyString { + * // value must be a valid IPv6 prefix + * string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + * } + * ``` * @type int $well_known_regex - * `well_known_regex` specifies a common well-known pattern - * defined as a regex. If the field value doesn't match the well-known - * regex, an error message will be generated. - * ```proto - * message MyString { - * // value must be a valid HTTP header value + * `well_known_regex` specifies a common well-known pattern + * defined as a regex. If the field value doesn't match the well-known + * regex, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid HTTP header value * string value = 1 [(buf.validate.field).string.well_known_regex = 2]; - * } - * ``` - * #### KnownRegex - * `well_known_regex` contains some well-known patterns. - * | Name | Number | Description | - * |-------------------------------|--------|-------------------------------------------| - * | KNOWN_REGEX_UNSPECIFIED | 0 | | - * | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | - * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | + * } + * ``` + * #### KnownRegex + * `well_known_regex` contains some well-known patterns. + * | Name | Number | Description | + * |-------------------------------|--------|-------------------------------------------| + * | KNOWN_REGEX_UNSPECIFIED | 0 | | + * | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | + * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * @type bool $strict - * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to - * enable strict header validation. By default, this is true, and HTTP header - * validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser - * validations that only disallow `\r\n\0` characters, which can be used to - * bypass header matching rules. - * ```proto - * message MyString { + * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + * enable strict header validation. By default, this is true, and HTTP header + * validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser + * validations that only disallow `\r\n\0` characters, which can be used to + * bypass header matching rules. + * ```proto + * message MyString { * // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. * string value = 1 [(buf.validate.field).string.strict = false]; - * } - * ``` + * } + * ``` * } */ public function __construct($data = NULL) { @@ -515,14 +580,14 @@ public function __construct($data = NULL) { } /** - *`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 MyString { - * // value must equal `hello` + * `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 MyString { + * // value must equal `hello` * string value = 1 [(buf.validate.field).string.const = "hello"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return string @@ -543,14 +608,14 @@ public function clearConst() } /** - *`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 MyString { - * // value must equal `hello` + * `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 MyString { + * // value must equal `hello` * string value = 1 [(buf.validate.field).string.const = "hello"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param string $var @@ -565,16 +630,16 @@ public function setConst($var) } /** - *`len` dictates that the field value must have the specified - *number of characters (Unicode code points), which may differ from the number - *of bytes in the string. If the field value does not meet the specified - *length, an error message will be generated. - *```proto - *message MyString { - * // value length must be 5 characters + * `len` dictates that the field value must have the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value does not meet the specified + * length, an error message will be generated. + * ```proto + * message MyString { + * // value length must be 5 characters * string value = 1 [(buf.validate.field).string.len = 5]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { * @return int|string @@ -595,16 +660,16 @@ public function clearLen() } /** - *`len` dictates that the field value must have the specified - *number of characters (Unicode code points), which may differ from the number - *of bytes in the string. If the field value does not meet the specified - *length, an error message will be generated. - *```proto - *message MyString { - * // value length must be 5 characters + * `len` dictates that the field value must have the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value does not meet the specified + * length, an error message will be generated. + * ```proto + * message MyString { + * // value length must be 5 characters * string value = 1 [(buf.validate.field).string.len = 5]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { * @param int|string $var @@ -619,16 +684,16 @@ public function setLen($var) } /** - *`min_len` specifies that the field value must have at least the specified - *number of characters (Unicode code points), which may differ from the number - *of bytes in the string. If the field value contains fewer characters, an error - *message will be generated. - *```proto - *message MyString { - * // value length must be at least 3 characters + * `min_len` specifies that the field value must have at least the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value contains fewer characters, an error + * message will be generated. + * ```proto + * message MyString { + * // value length must be at least 3 characters * string value = 1 [(buf.validate.field).string.min_len = 3]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { * @return int|string @@ -649,16 +714,16 @@ public function clearMinLen() } /** - *`min_len` specifies that the field value must have at least the specified - *number of characters (Unicode code points), which may differ from the number - *of bytes in the string. If the field value contains fewer characters, an error - *message will be generated. - *```proto - *message MyString { - * // value length must be at least 3 characters + * `min_len` specifies that the field value must have at least the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value contains fewer characters, an error + * message will be generated. + * ```proto + * message MyString { + * // value length must be at least 3 characters * string value = 1 [(buf.validate.field).string.min_len = 3]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { * @param int|string $var @@ -673,16 +738,16 @@ public function setMinLen($var) } /** - *`max_len` specifies that the field value must have no more than the specified - *number of characters (Unicode code points), which may differ from the - *number of bytes in the string. If the field value contains more characters, - *an error message will be generated. - *```proto - *message MyString { - * // value length must be at most 10 characters + * `max_len` specifies that the field value must have no more than the specified + * number of characters (Unicode code points), which may differ from the + * number of bytes in the string. If the field value contains more characters, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 10 characters * string value = 1 [(buf.validate.field).string.max_len = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { * @return int|string @@ -703,16 +768,16 @@ public function clearMaxLen() } /** - *`max_len` specifies that the field value must have no more than the specified - *number of characters (Unicode code points), which may differ from the - *number of bytes in the string. If the field value contains more characters, - *an error message will be generated. - *```proto - *message MyString { - * // value length must be at most 10 characters + * `max_len` specifies that the field value must have no more than the specified + * number of characters (Unicode code points), which may differ from the + * number of bytes in the string. If the field value contains more characters, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 10 characters * string value = 1 [(buf.validate.field).string.max_len = 10]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { * @param int|string $var @@ -727,15 +792,15 @@ public function setMaxLen($var) } /** - *`len_bytes` dictates that the field value must have the specified number of - *bytes. If the field value does not match the specified length in bytes, - *an error message will be generated. - *```proto - *message MyString { - * // value length must be 6 bytes + * `len_bytes` dictates that the field value must have the specified number of + * bytes. If the field value does not match the specified length in bytes, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be 6 bytes * string value = 1 [(buf.validate.field).string.len_bytes = 6]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { * @return int|string @@ -756,15 +821,15 @@ public function clearLenBytes() } /** - *`len_bytes` dictates that the field value must have the specified number of - *bytes. If the field value does not match the specified length in bytes, - *an error message will be generated. - *```proto - *message MyString { - * // value length must be 6 bytes + * `len_bytes` dictates that the field value must have the specified number of + * bytes. If the field value does not match the specified length in bytes, + * an error message will be generated. + * ```proto + * message MyString { + * // value length must be 6 bytes * string value = 1 [(buf.validate.field).string.len_bytes = 6]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { * @param int|string $var @@ -779,15 +844,15 @@ public function setLenBytes($var) } /** - *`min_bytes` specifies that the field value must have at least the specified - *number of bytes. If the field value contains fewer bytes, an error message - *will be generated. - *```proto - *message MyString { - * // value length must be at least 4 bytes + * `min_bytes` specifies that the field value must have at least the specified + * number of bytes. If the field value contains fewer bytes, an error message + * will be generated. + * ```proto + * message MyString { + * // value length must be at least 4 bytes * string value = 1 [(buf.validate.field).string.min_bytes = 4]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { * @return int|string @@ -808,15 +873,15 @@ public function clearMinBytes() } /** - *`min_bytes` specifies that the field value must have at least the specified - *number of bytes. If the field value contains fewer bytes, an error message - *will be generated. - *```proto - *message MyString { - * // value length must be at least 4 bytes + * `min_bytes` specifies that the field value must have at least the specified + * number of bytes. If the field value contains fewer bytes, an error message + * will be generated. + * ```proto + * message MyString { + * // value length must be at least 4 bytes * string value = 1 [(buf.validate.field).string.min_bytes = 4]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { * @param int|string $var @@ -831,15 +896,15 @@ public function setMinBytes($var) } /** - *`max_bytes` specifies that the field value must have no more than the + * `max_bytes` specifies that the field value must have no more than the *specified number of bytes. If the field value contains more bytes, an - *error message will be generated. - *```proto - *message MyString { - * // value length must be at most 8 bytes + * error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 8 bytes * string value = 1 [(buf.validate.field).string.max_bytes = 8]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { * @return int|string @@ -860,15 +925,15 @@ public function clearMaxBytes() } /** - *`max_bytes` specifies that the field value must have no more than the + * `max_bytes` specifies that the field value must have no more than the *specified number of bytes. If the field value contains more bytes, an - *error message will be generated. - *```proto - *message MyString { - * // value length must be at most 8 bytes + * error message will be generated. + * ```proto + * message MyString { + * // value length must be at most 8 bytes * string value = 1 [(buf.validate.field).string.max_bytes = 8]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { * @param int|string $var @@ -883,16 +948,16 @@ public function setMaxBytes($var) } /** - *`pattern` specifies that the field value must match the specified - *regular expression (RE2 syntax), with the expression provided without any - *delimiters. If the field value doesn't match the regular expression, an - *error message will be generated. - *```proto - *message MyString { - * // value does not match regex pattern `^[a-zA-Z]//$` + * `pattern` specifies that the field value must match the specified + * regular expression (RE2 syntax), with the expression provided without any + * delimiters. If the field value doesn't match the regular expression, an + * error message will be generated. + * ```proto + * message MyString { + * // value does not match regex pattern `^[a-zA-Z]//$` * string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { * @return string @@ -913,16 +978,16 @@ public function clearPattern() } /** - *`pattern` specifies that the field value must match the specified - *regular expression (RE2 syntax), with the expression provided without any - *delimiters. If the field value doesn't match the regular expression, an - *error message will be generated. - *```proto - *message MyString { - * // value does not match regex pattern `^[a-zA-Z]//$` + * `pattern` specifies that the field value must match the specified + * regular expression (RE2 syntax), with the expression provided without any + * delimiters. If the field value doesn't match the regular expression, an + * error message will be generated. + * ```proto + * message MyString { + * // value does not match regex pattern `^[a-zA-Z]//$` * string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { * @param string $var @@ -937,16 +1002,16 @@ public function setPattern($var) } /** - *`prefix` specifies that the field value must have the + * `prefix` specifies that the field value must have the *specified substring at the beginning of the string. If the field value - *doesn't start with the specified prefix, an error message will be - *generated. - *```proto - *message MyString { - * // value does not have prefix `pre` + * doesn't start with the specified prefix, an error message will be + * generated. + * ```proto + * message MyString { + * // value does not have prefix `pre` * string value = 1 [(buf.validate.field).string.prefix = "pre"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { * @return string @@ -967,16 +1032,16 @@ public function clearPrefix() } /** - *`prefix` specifies that the field value must have the + * `prefix` specifies that the field value must have the *specified substring at the beginning of the string. If the field value - *doesn't start with the specified prefix, an error message will be - *generated. - *```proto - *message MyString { - * // value does not have prefix `pre` + * doesn't start with the specified prefix, an error message will be + * generated. + * ```proto + * message MyString { + * // value does not have prefix `pre` * string value = 1 [(buf.validate.field).string.prefix = "pre"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { * @param string $var @@ -991,15 +1056,15 @@ public function setPrefix($var) } /** - *`suffix` specifies that the field value must have the + * `suffix` specifies that the field value must have the *specified substring at the end of the string. If the field value doesn't - *end with the specified suffix, an error message will be generated. - *```proto - *message MyString { - * // value does not have suffix `post` + * end with the specified suffix, an error message will be generated. + * ```proto + * message MyString { + * // value does not have suffix `post` * string value = 1 [(buf.validate.field).string.suffix = "post"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { * @return string @@ -1020,15 +1085,15 @@ public function clearSuffix() } /** - *`suffix` specifies that the field value must have the + * `suffix` specifies that the field value must have the *specified substring at the end of the string. If the field value doesn't - *end with the specified suffix, an error message will be generated. - *```proto - *message MyString { - * // value does not have suffix `post` + * end with the specified suffix, an error message will be generated. + * ```proto + * message MyString { + * // value does not have suffix `post` * string value = 1 [(buf.validate.field).string.suffix = "post"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { * @param string $var @@ -1043,15 +1108,15 @@ public function setSuffix($var) } /** - *`contains` specifies that the field value must have the + * `contains` specifies that the field value must have the *specified substring anywhere in the string. If the field value doesn't - *contain the specified substring, an error message will be generated. - *```proto - *message MyString { - * // value does not contain substring `inside`. + * contain the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value does not contain substring `inside`. * string value = 1 [(buf.validate.field).string.contains = "inside"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { * @return string @@ -1072,15 +1137,15 @@ public function clearContains() } /** - *`contains` specifies that the field value must have the + * `contains` specifies that the field value must have the *specified substring anywhere in the string. If the field value doesn't - *contain the specified substring, an error message will be generated. - *```proto - *message MyString { - * // value does not contain substring `inside`. + * contain the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value does not contain substring `inside`. * string value = 1 [(buf.validate.field).string.contains = "inside"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { * @param string $var @@ -1095,15 +1160,15 @@ public function setContains($var) } /** - *`not_contains` specifies that the field value must not have the + * `not_contains` specifies that the field value must not have the *specified substring anywhere in the string. If the field value contains - *the specified substring, an error message will be generated. - *```proto - *message MyString { - * // value contains substring `inside`. + * the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value contains substring `inside`. * string value = 1 [(buf.validate.field).string.not_contains = "inside"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { * @return string @@ -1124,15 +1189,15 @@ public function clearNotContains() } /** - *`not_contains` specifies that the field value must not have the + * `not_contains` specifies that the field value must not have the *specified substring anywhere in the string. If the field value contains - *the specified substring, an error message will be generated. - *```proto - *message MyString { - * // value contains substring `inside`. + * the specified substring, an error message will be generated. + * ```proto + * message MyString { + * // value contains substring `inside`. * string value = 1 [(buf.validate.field).string.not_contains = "inside"]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { * @param string $var @@ -1147,15 +1212,15 @@ public function setNotContains($var) } /** - *`in` specifies that the field value must be equal to one of the specified - *values. If the field value isn't one of the specified values, an error - *message will be generated. - *```proto - *message MyString { - * // value must be in list ["apple", "banana"] - * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; - *} - *``` + * `in` specifies that the field value must be equal to one of the specified + * values. If the field value isn't one of the specified values, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be in list ["apple", "banana"] + * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + * } + * ``` * * Generated from protobuf field repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -1166,15 +1231,15 @@ public function getIn() } /** - *`in` specifies that the field value must be equal to one of the specified - *values. If the field value isn't one of the specified values, an error - *message will be generated. - *```proto - *message MyString { - * // value must be in list ["apple", "banana"] - * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; - *} - *``` + * `in` specifies that the field value must be equal to one of the specified + * values. If the field value isn't one of the specified values, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be in list ["apple", "banana"] + * repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + * } + * ``` * * Generated from protobuf field repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -1189,15 +1254,15 @@ public function setIn($var) } /** - *`not_in` specifies that the field value cannot be equal to any - *of the specified values. If the field value is one of the specified values, - *an error message will be generated. - *```proto - *message MyString { - * // value must not be in list ["orange", "grape"] - * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; - *} - *``` + * `not_in` specifies that the field value cannot be equal to any + * of the specified values. If the field value is one of the specified values, + * an error message will be generated. + * ```proto + * message MyString { + * // value must not be in list ["orange", "grape"] + * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + * } + * ``` * * Generated from protobuf field repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -1208,15 +1273,15 @@ public function getNotIn() } /** - *`not_in` specifies that the field value cannot be equal to any - *of the specified values. If the field value is one of the specified values, - *an error message will be generated. - *```proto - *message MyString { - * // value must not be in list ["orange", "grape"] - * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; - *} - *``` + * `not_in` specifies that the field value cannot be equal to any + * of the specified values. If the field value is one of the specified values, + * an error message will be generated. + * ```proto + * message MyString { + * // value must not be in list ["orange", "grape"] + * repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + * } + * ``` * * Generated from protobuf field repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -1231,15 +1296,15 @@ public function setNotIn($var) } /** - *`email` specifies that the field value must be a valid email address - *(addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). - *If the field value isn't a valid email address, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid email address + * `email` specifies that the field value must be a valid email address + * (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). + * If the field value isn't a valid email address, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid email address * string value = 1 [(buf.validate.field).string.email = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { * @return bool @@ -1255,15 +1320,15 @@ public function hasEmail() } /** - *`email` specifies that the field value must be a valid email address - *(addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). - *If the field value isn't a valid email address, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid email address + * `email` specifies that the field value must be a valid email address + * (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1). + * If the field value isn't a valid email address, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid email address * string value = 1 [(buf.validate.field).string.email = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { * @param bool $var @@ -1278,16 +1343,16 @@ public function setEmail($var) } /** - *`hostname` specifies that the field value must be a valid - *hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support - *internationalized domain names (IDNs). If the field value isn't a - *valid hostname, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid hostname + * `hostname` specifies that the field value must be a valid + * hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support + * internationalized domain names (IDNs). If the field value isn't a + * valid hostname, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid hostname * string value = 1 [(buf.validate.field).string.hostname = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { * @return bool @@ -1303,16 +1368,16 @@ public function hasHostname() } /** - *`hostname` specifies that the field value must be a valid - *hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support - *internationalized domain names (IDNs). If the field value isn't a - *valid hostname, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid hostname + * `hostname` specifies that the field value must be a valid + * hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support + * internationalized domain names (IDNs). If the field value isn't a + * valid hostname, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid hostname * string value = 1 [(buf.validate.field).string.hostname = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { * @param bool $var @@ -1327,16 +1392,16 @@ public function setHostname($var) } /** - *`ip` specifies that the field value must be a valid IP - *(v4 or v6) address, without surrounding square brackets for IPv6 addresses. - *If the field value isn't a valid IP address, an error message will be - *generated. - *```proto - *message MyString { - * // value must be a valid IP address + * `ip` specifies that the field value must be a valid IP + * (v4 or v6) address, without surrounding square brackets for IPv6 addresses. + * If the field value isn't a valid IP address, an error message will be + * generated. + * ```proto + * message MyString { + * // value must be a valid IP address * string value = 1 [(buf.validate.field).string.ip = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { * @return bool @@ -1352,16 +1417,16 @@ public function hasIp() } /** - *`ip` specifies that the field value must be a valid IP - *(v4 or v6) address, without surrounding square brackets for IPv6 addresses. - *If the field value isn't a valid IP address, an error message will be - *generated. - *```proto - *message MyString { - * // value must be a valid IP address + * `ip` specifies that the field value must be a valid IP + * (v4 or v6) address, without surrounding square brackets for IPv6 addresses. + * If the field value isn't a valid IP address, an error message will be + * generated. + * ```proto + * message MyString { + * // value must be a valid IP address * string value = 1 [(buf.validate.field).string.ip = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { * @param bool $var @@ -1376,15 +1441,15 @@ public function setIp($var) } /** - *`ipv4` specifies that the field value must be a valid IPv4 - *address. If the field value isn't a valid IPv4 address, an error message - *will be generated. - *```proto - *message MyString { - * // value must be a valid IPv4 address + * `ipv4` specifies that the field value must be a valid IPv4 + * address. If the field value isn't a valid IPv4 address, an error message + * will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv4 address * string value = 1 [(buf.validate.field).string.ipv4 = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { * @return bool @@ -1400,15 +1465,15 @@ public function hasIpv4() } /** - *`ipv4` specifies that the field value must be a valid IPv4 - *address. If the field value isn't a valid IPv4 address, an error message - *will be generated. - *```proto - *message MyString { - * // value must be a valid IPv4 address + * `ipv4` specifies that the field value must be a valid IPv4 + * address. If the field value isn't a valid IPv4 address, an error message + * will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv4 address * string value = 1 [(buf.validate.field).string.ipv4 = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { * @param bool $var @@ -1423,15 +1488,15 @@ public function setIpv4($var) } /** - *`ipv6` specifies that the field value must be a valid - *IPv6 address, without surrounding square brackets. If the field value is - *not a valid IPv6 address, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid IPv6 address + * `ipv6` specifies that the field value must be a valid + * IPv6 address, without surrounding square brackets. If the field value is + * not a valid IPv6 address, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv6 address * string value = 1 [(buf.validate.field).string.ipv6 = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { * @return bool @@ -1447,15 +1512,15 @@ public function hasIpv6() } /** - *`ipv6` specifies that the field value must be a valid - *IPv6 address, without surrounding square brackets. If the field value is - *not a valid IPv6 address, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid IPv6 address + * `ipv6` specifies that the field value must be a valid + * IPv6 address, without surrounding square brackets. If the field value is + * not a valid IPv6 address, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv6 address * string value = 1 [(buf.validate.field).string.ipv6 = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { * @param bool $var @@ -1470,15 +1535,15 @@ public function setIpv6($var) } /** - *`uri` specifies that the field value must be a valid, - *absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, - *absolute URI, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid URI + * `uri` specifies that the field value must be a valid, + * absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, + * absolute URI, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid URI * string value = 1 [(buf.validate.field).string.uri = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { * @return bool @@ -1494,15 +1559,15 @@ public function hasUri() } /** - *`uri` specifies that the field value must be a valid, - *absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, - *absolute URI, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid URI + * `uri` specifies that the field value must be a valid, + * absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid, + * absolute URI, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid URI * string value = 1 [(buf.validate.field).string.uri = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { * @param bool $var @@ -1517,15 +1582,15 @@ public function setUri($var) } /** - *`uri_ref` specifies that the field value must be a valid URI - *as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the - *field value isn't a valid URI, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid URI + * `uri_ref` specifies that the field value must be a valid URI + * as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the + * field value isn't a valid URI, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid URI * string value = 1 [(buf.validate.field).string.uri_ref = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { * @return bool @@ -1541,15 +1606,15 @@ public function hasUriRef() } /** - *`uri_ref` specifies that the field value must be a valid URI - *as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the - *field value isn't a valid URI, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid URI + * `uri_ref` specifies that the field value must be a valid URI + * as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the + * field value isn't a valid URI, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid URI * string value = 1 [(buf.validate.field).string.uri_ref = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { * @param bool $var @@ -1564,17 +1629,17 @@ public function setUriRef($var) } /** - *`address` specifies that the field value must be either a valid hostname - *as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) - *(which doesn't support internationalized domain names or IDNs) or a valid - *IP (v4 or v6). If the field value isn't a valid hostname or IP, an error - *message will be generated. - *```proto - *message MyString { - * // value must be a valid hostname, or ip address + * `address` specifies that the field value must be either a valid hostname + * as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) + * (which doesn't support internationalized domain names or IDNs) or a valid + * IP (v4 or v6). If the field value isn't a valid hostname or IP, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be a valid hostname, or ip address * string value = 1 [(buf.validate.field).string.address = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { * @return bool @@ -1590,17 +1655,17 @@ public function hasAddress() } /** - *`address` specifies that the field value must be either a valid hostname - *as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) - *(which doesn't support internationalized domain names or IDNs) or a valid - *IP (v4 or v6). If the field value isn't a valid hostname or IP, an error - *message will be generated. - *```proto - *message MyString { - * // value must be a valid hostname, or ip address + * `address` specifies that the field value must be either a valid hostname + * as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5) + * (which doesn't support internationalized domain names or IDNs) or a valid + * IP (v4 or v6). If the field value isn't a valid hostname or IP, an error + * message will be generated. + * ```proto + * message MyString { + * // value must be a valid hostname, or ip address * string value = 1 [(buf.validate.field).string.address = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { * @param bool $var @@ -1615,15 +1680,15 @@ public function setAddress($var) } /** - *`uuid` specifies that the field value must be a valid UUID as defined by - *[RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the - *field value isn't a valid UUID, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid UUID + * `uuid` specifies that the field value must be a valid UUID as defined by + * [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the + * field value isn't a valid UUID, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid UUID * string value = 1 [(buf.validate.field).string.uuid = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { * @return bool @@ -1639,15 +1704,15 @@ public function hasUuid() } /** - *`uuid` specifies that the field value must be a valid UUID as defined by - *[RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the - *field value isn't a valid UUID, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid UUID + * `uuid` specifies that the field value must be a valid UUID as defined by + * [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the + * field value isn't a valid UUID, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid UUID * string value = 1 [(buf.validate.field).string.uuid = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { * @param bool $var @@ -1662,22 +1727,314 @@ public function setUuid($var) } /** - *`well_known_regex` specifies a common well-known pattern - *defined as a regex. If the field value doesn't match the well-known - *regex, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid HTTP header value + * `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) + * address with prefix length. If the field value isn't a valid IP with prefix + * length, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IP with prefix length + * string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + * } + * ``` + * + * Generated from protobuf field bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { + * @return bool + */ + public function getIpWithPrefixlen() + { + return $this->readOneof(26); + } + + public function hasIpWithPrefixlen() + { + return $this->hasOneof(26); + } + + /** + * `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6) + * address with prefix length. If the field value isn't a valid IP with prefix + * length, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IP with prefix length + * string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + * } + * ``` + * + * Generated from protobuf field bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { + * @param bool $var + * @return $this + */ + public function setIpWithPrefixlen($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * `ipv4_with_prefixlen` specifies that the field value must be a valid + * IPv4 address with prefix. + * If the field value isn't a valid IPv4 address with prefix length, + * an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv4 address with prefix lentgh + * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { + * @return bool + */ + public function getIpv4WithPrefixlen() + { + return $this->readOneof(27); + } + + public function hasIpv4WithPrefixlen() + { + return $this->hasOneof(27); + } + + /** + * `ipv4_with_prefixlen` specifies that the field value must be a valid + * IPv4 address with prefix. + * If the field value isn't a valid IPv4 address with prefix length, + * an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv4 address with prefix lentgh + * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { + * @param bool $var + * @return $this + */ + public function setIpv4WithPrefixlen($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * `ipv6_with_prefixlen` specifies that the field value must be a valid + * IPv6 address with prefix length. + * If the field value is not a valid IPv6 address with prefix length, + * an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv6 address prefix length + * string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { + * @return bool + */ + public function getIpv6WithPrefixlen() + { + return $this->readOneof(28); + } + + public function hasIpv6WithPrefixlen() + { + return $this->hasOneof(28); + } + + /** + * `ipv6_with_prefixlen` specifies that the field value must be a valid + * IPv6 address with prefix length. + * If the field value is not a valid IPv6 address with prefix length, + * an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid IPv6 address prefix length + * string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { + * @param bool $var + * @return $this + */ + public function setIpv6WithPrefixlen($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(28, $var); + + return $this; + } + + /** + * `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. + * If the field value isn't a valid IP prefix, an error message will be + * generated. The prefix must have all zeros for the masked bits of the prefix (e.g., + * `127.0.0.0/16`, not `127.0.0.1/16`). + * ```proto + * message MyString { + * // value must be a valid IP prefix + * string value = 1 [(buf.validate.field).string.ip_prefix = true]; + * } + * ``` + * + * Generated from protobuf field bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { + * @return bool + */ + public function getIpPrefix() + { + return $this->readOneof(29); + } + + public function hasIpPrefix() + { + return $this->hasOneof(29); + } + + /** + * `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix. + * If the field value isn't a valid IP prefix, an error message will be + * generated. The prefix must have all zeros for the masked bits of the prefix (e.g., + * `127.0.0.0/16`, not `127.0.0.1/16`). + * ```proto + * message MyString { + * // value must be a valid IP prefix + * string value = 1 [(buf.validate.field).string.ip_prefix = true]; + * } + * ``` + * + * Generated from protobuf field bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { + * @param bool $var + * @return $this + */ + public function setIpPrefix($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(29, $var); + + return $this; + } + + /** + * `ipv4_prefix` specifies that the field value must be a valid IPv4 + * prefix. If the field value isn't a valid IPv4 prefix, an error message + * will be generated. The prefix must have all zeros for the masked bits of + * the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). + * ```proto + * message MyString { + * // value must be a valid IPv4 prefix + * string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { + * @return bool + */ + public function getIpv4Prefix() + { + return $this->readOneof(30); + } + + public function hasIpv4Prefix() + { + return $this->hasOneof(30); + } + + /** + * `ipv4_prefix` specifies that the field value must be a valid IPv4 + * prefix. If the field value isn't a valid IPv4 prefix, an error message + * will be generated. The prefix must have all zeros for the masked bits of + * the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`). + * ```proto + * message MyString { + * // value must be a valid IPv4 prefix + * string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { + * @param bool $var + * @return $this + */ + public function setIpv4Prefix($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(30, $var); + + return $this; + } + + /** + * `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. + * If the field value is not a valid IPv6 prefix, an error message will be + * generated. The prefix must have all zeros for the masked bits of the prefix + * (e.g., `2001:db8::/48`, not `2001:db8::1/48`). + * ```proto + * message MyString { + * // value must be a valid IPv6 prefix + * string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { + * @return bool + */ + public function getIpv6Prefix() + { + return $this->readOneof(31); + } + + public function hasIpv6Prefix() + { + return $this->hasOneof(31); + } + + /** + * `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix. + * If the field value is not a valid IPv6 prefix, an error message will be + * generated. The prefix must have all zeros for the masked bits of the prefix + * (e.g., `2001:db8::/48`, not `2001:db8::1/48`). + * ```proto + * message MyString { + * // value must be a valid IPv6 prefix + * string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + * } + * ``` + * + * Generated from protobuf field bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { + * @param bool $var + * @return $this + */ + public function setIpv6Prefix($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(31, $var); + + return $this; + } + + /** + * `well_known_regex` specifies a common well-known pattern + * defined as a regex. If the field value doesn't match the well-known + * regex, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid HTTP header value * string value = 1 [(buf.validate.field).string.well_known_regex = 2]; - *} - *``` - *#### KnownRegex - *`well_known_regex` contains some well-known patterns. - *| Name | Number | Description | - *|-------------------------------|--------|-------------------------------------------| - *| KNOWN_REGEX_UNSPECIFIED | 0 | | - *| KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | - *| KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | + * } + * ``` + * #### KnownRegex + * `well_known_regex` contains some well-known patterns. + * | Name | Number | Description | + * |-------------------------------|--------|-------------------------------------------| + * | KNOWN_REGEX_UNSPECIFIED | 0 | | + * | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | + * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * Generated from protobuf field .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { * @return int @@ -1693,22 +2050,22 @@ public function hasWellKnownRegex() } /** - *`well_known_regex` specifies a common well-known pattern - *defined as a regex. If the field value doesn't match the well-known - *regex, an error message will be generated. - *```proto - *message MyString { - * // value must be a valid HTTP header value + * `well_known_regex` specifies a common well-known pattern + * defined as a regex. If the field value doesn't match the well-known + * regex, an error message will be generated. + * ```proto + * message MyString { + * // value must be a valid HTTP header value * string value = 1 [(buf.validate.field).string.well_known_regex = 2]; - *} - *``` - *#### KnownRegex - *`well_known_regex` contains some well-known patterns. - *| Name | Number | Description | - *|-------------------------------|--------|-------------------------------------------| - *| KNOWN_REGEX_UNSPECIFIED | 0 | | - *| KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | - *| KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | + * } + * ``` + * #### KnownRegex + * `well_known_regex` contains some well-known patterns. + * | Name | Number | Description | + * |-------------------------------|--------|-------------------------------------------| + * | KNOWN_REGEX_UNSPECIFIED | 0 | | + * | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | + * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * Generated from protobuf field .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { * @param int $var @@ -1723,17 +2080,17 @@ public function setWellKnownRegex($var) } /** - *This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to - *enable strict header validation. By default, this is true, and HTTP header - *validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser - *validations that only disallow `\r\n\0` characters, which can be used to - *bypass header matching rules. - *```proto - *message MyString { + * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + * enable strict header validation. By default, this is true, and HTTP header + * validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser + * validations that only disallow `\r\n\0` characters, which can be used to + * bypass header matching rules. + * ```proto + * message MyString { * // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. * string value = 1 [(buf.validate.field).string.strict = false]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool strict = 25 [json_name = "strict"]; * @return bool @@ -1754,17 +2111,17 @@ public function clearStrict() } /** - *This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to - *enable strict header validation. By default, this is true, and HTTP header - *validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser - *validations that only disallow `\r\n\0` characters, which can be used to - *bypass header matching rules. - *```proto - *message MyString { + * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + * enable strict header validation. By default, this is true, and HTTP header + * validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser + * validations that only disallow `\r\n\0` characters, which can be used to + * bypass header matching rules. + * ```proto + * message MyString { * // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. * string value = 1 [(buf.validate.field).string.strict = false]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional bool strict = 25 [json_name = "strict"]; * @param bool $var diff --git a/src/Buf/Validate/TimestampRules.php b/src/Buf/Validate/TimestampRules.php index 7b8f028..53e901c 100644 --- a/src/Buf/Validate/TimestampRules.php +++ b/src/Buf/Validate/TimestampRules.php @@ -16,25 +16,25 @@ class TimestampRules extends \Google\Protobuf\Internal\Message { /** - *`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. - *```proto - *message MyTimestamp { - * // value must equal 2023-05-03T10:00:00Z + * `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. + * ```proto + * message MyTimestamp { + * // value must equal 2023-05-03T10:00:00Z * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** * `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. - *```proto - *message MyTimestamp { - * // value must be within 1 hour of now + * ```proto + * message MyTimestamp { + * // value must be within 1 hour of now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { */ @@ -49,13 +49,13 @@ class TimestampRules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Protobuf\Timestamp $const - * `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. - * ```proto - * message MyTimestamp { - * // value must equal 2023-05-03T10:00:00Z + * `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. + * ```proto + * message MyTimestamp { + * // value must equal 2023-05-03T10:00:00Z * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; - * } - * ``` + * } + * ``` * @type \Google\Protobuf\Timestamp $lt * 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. * ```proto @@ -73,61 +73,61 @@ class TimestampRules extends \Google\Protobuf\Internal\Message * } * ``` * @type bool $lt_now - * `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. - * ```proto - * message MyTimestamp { + * `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. + * ```proto + * message MyTimestamp { * // value must be less than now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; - * } - * ``` + * } + * ``` * @type \Google\Protobuf\Timestamp $gt - * `gt` requires the timestamp field value to be greater than the specified + * `gt` requires the timestamp 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 MyTimestamp { - * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] - * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; - * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] - * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; - * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] - * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - * } - * ``` + * ```proto + * message MyTimestamp { + * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` * @type \Google\Protobuf\Timestamp $gte - * `gte` requires the timestamp field value to be greater than or equal to the + * `gte` requires the timestamp 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 MyTimestamp { - * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] - * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; - * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] - * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; - * // 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] - * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - * } - * ``` + * ```proto + * message MyTimestamp { + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * // 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] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` * @type bool $gt_now - * `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. - * ```proto - * message MyTimestamp { - * // value must be greater than now + * `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. + * ```proto + * message MyTimestamp { + * // value must be greater than now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; - * } - * ``` + * } + * ``` * @type \Google\Protobuf\Duration $within * `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. - * ```proto - * message MyTimestamp { - * // value must be within 1 hour of now + * ```proto + * message MyTimestamp { + * // value must be within 1 hour of now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; - * } - * ``` + * } + * ``` * } */ public function __construct($data = NULL) { @@ -136,13 +136,13 @@ public function __construct($data = NULL) { } /** - *`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. - *```proto - *message MyTimestamp { - * // value must equal 2023-05-03T10:00:00Z + * `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. + * ```proto + * message MyTimestamp { + * // value must equal 2023-05-03T10:00:00Z * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Timestamp|null @@ -163,13 +163,13 @@ public function clearConst() } /** - *`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. - *```proto - *message MyTimestamp { - * // value must equal 2023-05-03T10:00:00Z + * `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. + * ```proto + * message MyTimestamp { + * // value must equal 2023-05-03T10:00:00Z * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Timestamp $var @@ -270,13 +270,13 @@ public function setLte($var) } /** - *`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. - *```proto - *message MyTimestamp { + * `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. + * ```proto + * message MyTimestamp { * // value must be less than now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { * @return bool @@ -292,13 +292,13 @@ public function hasLtNow() } /** - *`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. - *```proto - *message MyTimestamp { + * `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. + * ```proto + * message MyTimestamp { * // value must be less than now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { * @param bool $var @@ -313,21 +313,21 @@ public function setLtNow($var) } /** - *`gt` requires the timestamp field value to be greater than the specified + * `gt` requires the timestamp 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 MyTimestamp { - * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] - * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; - * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] - * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; - * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] - * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - *} - *``` + * ```proto + * message MyTimestamp { + * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` * * Generated from protobuf field .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Timestamp|null @@ -343,21 +343,21 @@ public function hasGt() } /** - *`gt` requires the timestamp field value to be greater than the specified + * `gt` requires the timestamp 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 MyTimestamp { - * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] - * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; - * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] - * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; - * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] - * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - *} - *``` + * ```proto + * message MyTimestamp { + * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` * * Generated from protobuf field .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Timestamp $var @@ -372,21 +372,21 @@ public function setGt($var) } /** - *`gte` requires the timestamp field value to be greater than or equal to the + * `gte` requires the timestamp 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 MyTimestamp { - * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] - * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; - * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] - * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; - * // 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] - * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - *} - *``` + * ```proto + * message MyTimestamp { + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * // 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] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` * * Generated from protobuf field .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Timestamp|null @@ -402,21 +402,21 @@ public function hasGte() } /** - *`gte` requires the timestamp field value to be greater than or equal to the + * `gte` requires the timestamp 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 MyTimestamp { - * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] - * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; - * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] - * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; - * // 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] - * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; - *} - *``` + * ```proto + * message MyTimestamp { + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * // 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] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` * * Generated from protobuf field .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Timestamp $var @@ -431,13 +431,13 @@ public function setGte($var) } /** - *`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. - *```proto - *message MyTimestamp { - * // value must be greater than now + * `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. + * ```proto + * message MyTimestamp { + * // value must be greater than now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { * @return bool @@ -453,13 +453,13 @@ public function hasGtNow() } /** - *`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. - *```proto - *message MyTimestamp { - * // value must be greater than now + * `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. + * ```proto + * message MyTimestamp { + * // value must be greater than now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; - *} - *``` + * } + * ``` * * Generated from protobuf field bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { * @param bool $var @@ -475,12 +475,12 @@ public function setGtNow($var) /** * `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. - *```proto - *message MyTimestamp { - * // value must be within 1 hour of now + * ```proto + * message MyTimestamp { + * // value must be within 1 hour of now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Duration|null @@ -502,12 +502,12 @@ public function clearWithin() /** * `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. - *```proto - *message MyTimestamp { - * // value must be within 1 hour of now + * ```proto + * message MyTimestamp { + * // value must be within 1 hour of now * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { * @param \Google\Protobuf\Duration $var diff --git a/src/Buf/Validate/UInt32Rules.php b/src/Buf/Validate/UInt32Rules.php index 88dbff2..747cb8d 100644 --- a/src/Buf/Validate/UInt32Rules.php +++ b/src/Buf/Validate/UInt32Rules.php @@ -17,42 +17,42 @@ class UInt32Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt32 { + * // value must equal 42 * uint32 value = 1 [(buf.validate.field).uint32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt32 { + * // value must be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt32 { + * // value must not be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -67,86 +67,86 @@ class UInt32Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt32 { + * // value must equal 42 * uint32 value = 1 [(buf.validate.field).uint32.const = 42]; - * } - * ``` + * } + * ``` * @type int $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 + * ```proto + * message MyUInt32 { + * // value must be less than 10 * uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; - * } - * ``` + * } + * ``` * @type int $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 + * ```proto + * message MyUInt32 { + * // value must be less than or equal to 10 * uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; - * } - * ``` + * } + * ``` * @type int $gt - * `gt` requires the field value to be greater than the specified value + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type int $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyUInt32 { + * // value must be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; + * } + * ``` * @type array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyUInt32 { + * // value must not be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -155,14 +155,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt32 { + * // value must equal 42 * uint32 value = 1 [(buf.validate.field).uint32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int @@ -183,14 +183,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt32 { + * // value must equal 42 * uint32 value = 1 [(buf.validate.field).uint32.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int $var @@ -205,15 +205,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return int @@ -229,15 +229,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param int $var @@ -252,15 +252,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return int @@ -276,15 +276,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param int $var @@ -299,21 +299,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @return int @@ -329,21 +329,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @param int $var @@ -358,21 +358,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @return int @@ -388,21 +388,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @param int $var @@ -417,15 +417,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt32 { + * // value must be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -436,15 +436,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt32 { + * // value must be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -459,15 +459,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt32 { + * // value must not be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -478,15 +478,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt32 { + * // value must not be in list [1, 2, 3] + * repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Buf/Validate/UInt64Rules.php b/src/Buf/Validate/UInt64Rules.php index 213481d..c1ec318 100644 --- a/src/Buf/Validate/UInt64Rules.php +++ b/src/Buf/Validate/UInt64Rules.php @@ -17,42 +17,42 @@ class UInt64Rules extends \Google\Protobuf\Internal\Message { /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt64 { + * // value must equal 42 * uint64 value = 1 [(buf.validate.field).uint64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { */ protected $const = null; /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt64 { + * // value must be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { */ private $in; /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt64 { + * // value must not be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { */ @@ -67,86 +67,86 @@ class UInt64Rules extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $const - * `const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt64 { + * // value must equal 42 * uint64 value = 1 [(buf.validate.field).uint64.const = 42]; - * } - * ``` + * } + * ``` * @type int|string $lt - * `lt` requires the field value to be less than the specified value (field < + * `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 + * ```proto + * message MyUInt64 { + * // value must be less than 10 * uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; - * } - * ``` + * } + * ``` * @type int|string $lte - * `lte` requires the field value to be less than or equal to the specified + * `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 + * ```proto + * message MyUInt64 { + * // value must be less than or equal to 10 * uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; - * } - * ``` + * } + * ``` * @type int|string $gt - * `gt` requires the field value to be greater than the specified value + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type int|string $gte - * `gte` requires the field value to be greater than or equal to the specified + * `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 }]; - * } - * ``` + * ```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 }]; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $in - * `in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyUInt64 { + * // value must be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; + * } + * ``` * @type array|array|\Google\Protobuf\Internal\RepeatedField $not_in - * `not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; - * } - * ``` + * ```proto + * message MyUInt64 { + * // value must not be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; + * } + * ``` * } */ public function __construct($data = NULL) { @@ -155,14 +155,14 @@ public function __construct($data = NULL) { } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt64 { + * // value must equal 42 * uint64 value = 1 [(buf.validate.field).uint64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @return int|string @@ -183,14 +183,14 @@ public function clearConst() } /** - *`const` requires the field value to exactly match the specified value. If + * `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 + * ```proto + * message MyUInt64 { + * // value must equal 42 * uint64 value = 1 [(buf.validate.field).uint64.const = 42]; - *} - *``` + * } + * ``` * * Generated from protobuf field optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { * @param int|string $var @@ -205,15 +205,15 @@ public function setConst($var) } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @return int|string @@ -229,15 +229,15 @@ public function hasLt() } /** - *`lt` requires the field value to be less than the specified value (field < + * `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 + * ```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 [json_name = "lt", (.buf.validate.priv.field) = { * @param int|string $var @@ -252,15 +252,15 @@ public function setLt($var) } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @return int|string @@ -276,15 +276,15 @@ public function hasLte() } /** - *`lte` requires the field value to be less than or equal to the specified + * `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 + * ```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 [json_name = "lte", (.buf.validate.priv.field) = { * @param int|string $var @@ -299,21 +299,21 @@ public function setLte($var) } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @return int|string @@ -329,21 +329,21 @@ public function hasGt() } /** - *`gt` requires the field value to be greater than the specified value + * `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 }]; - *} - *``` + * ```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 [json_name = "gt", (.buf.validate.priv.field) = { * @param int|string $var @@ -358,21 +358,21 @@ public function setGt($var) } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @return int|string @@ -388,21 +388,21 @@ public function hasGte() } /** - *`gte` requires the field value to be greater than or equal to the specified + * `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 }]; - *} - *``` + * ```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 [json_name = "gte", (.buf.validate.priv.field) = { * @param int|string $var @@ -417,15 +417,15 @@ public function setGte($var) } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt64 { + * // value must be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -436,15 +436,15 @@ public function getIn() } /** - *`in` requires the field value to be equal to one of the specified values. + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt64 { + * // value must be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var @@ -459,15 +459,15 @@ public function setIn($var) } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt64 { + * // value must not be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -478,15 +478,15 @@ public function getNotIn() } /** - *`not_in` requires the field value to not be equal to any of the specified + * `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] - * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; - *} - *``` + * ```proto + * message MyUInt64 { + * // value must not be in list [1, 2, 3] + * repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; + * } + * ``` * * Generated from protobuf field repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { * @param array|array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/src/Cerbos/Response/V1/CheckResourcesResponse.php b/src/Cerbos/Response/V1/CheckResourcesResponse.php index 97081ba..256b869 100644 --- a/src/Cerbos/Response/V1/CheckResourcesResponse.php +++ b/src/Cerbos/Response/V1/CheckResourcesResponse.php @@ -21,6 +21,10 @@ class CheckResourcesResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .cerbos.response.v1.CheckResourcesResponse.ResultEntry results = 2 [json_name = "results", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { */ private $results; + /** + * Generated from protobuf field string cerbos_call_id = 3 [json_name = "cerbosCallId", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + */ + protected $cerbos_call_id = ''; /** * Constructor. @@ -30,6 +34,7 @@ class CheckResourcesResponse extends \Google\Protobuf\Internal\Message * * @type string $request_id * @type array<\Cerbos\Response\V1\CheckResourcesResponse\ResultEntry>|\Google\Protobuf\Internal\RepeatedField $results + * @type string $cerbos_call_id * } */ public function __construct($data = NULL) { @@ -81,5 +86,27 @@ public function setResults($var) return $this; } + /** + * Generated from protobuf field string cerbos_call_id = 3 [json_name = "cerbosCallId", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * @return string + */ + public function getCerbosCallId() + { + return $this->cerbos_call_id; + } + + /** + * Generated from protobuf field string cerbos_call_id = 3 [json_name = "cerbosCallId", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * @param string $var + * @return $this + */ + public function setCerbosCallId($var) + { + GPBUtil::checkString($var, True); + $this->cerbos_call_id = $var; + + return $this; + } + } diff --git a/src/Cerbos/Response/V1/PlanResourcesResponse.php b/src/Cerbos/Response/V1/PlanResourcesResponse.php index b7cb5db..f071a49 100644 --- a/src/Cerbos/Response/V1/PlanResourcesResponse.php +++ b/src/Cerbos/Response/V1/PlanResourcesResponse.php @@ -41,6 +41,10 @@ class PlanResourcesResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .cerbos.schema.v1.ValidationError validation_errors = 7 [json_name = "validationErrors", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { */ private $validation_errors; + /** + * Generated from protobuf field string cerbos_call_id = 8 [json_name = "cerbosCallId", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + */ + protected $cerbos_call_id = ''; /** * Constructor. @@ -55,6 +59,7 @@ class PlanResourcesResponse extends \Google\Protobuf\Internal\Message * @type \Cerbos\Engine\V1\PlanResourcesFilter $filter * @type \Cerbos\Response\V1\PlanResourcesResponse\Meta $meta * @type array<\Cerbos\Schema\V1\ValidationError>|\Google\Protobuf\Internal\RepeatedField $validation_errors + * @type string $cerbos_call_id * } */ public function __construct($data = NULL) { @@ -236,5 +241,27 @@ public function setValidationErrors($var) return $this; } + /** + * Generated from protobuf field string cerbos_call_id = 8 [json_name = "cerbosCallId", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * @return string + */ + public function getCerbosCallId() + { + return $this->cerbos_call_id; + } + + /** + * Generated from protobuf field string cerbos_call_id = 8 [json_name = "cerbosCallId", (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * @param string $var + * @return $this + */ + public function setCerbosCallId($var) + { + GPBUtil::checkString($var, True); + $this->cerbos_call_id = $var; + + return $this; + } + } diff --git a/src/Cerbos/Svc/V1/CerbosAdminServiceClient.php b/src/Cerbos/Svc/V1/CerbosAdminServiceClient.php index 4664616..71c1122 100644 --- a/src/Cerbos/Svc/V1/CerbosAdminServiceClient.php +++ b/src/Cerbos/Svc/V1/CerbosAdminServiceClient.php @@ -2,7 +2,7 @@ // GENERATED CODE -- DO NOT EDIT! // Original file comments: -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 // namespace Cerbos\Svc\V1; diff --git a/src/Cerbos/Svc/V1/CerbosPlaygroundServiceClient.php b/src/Cerbos/Svc/V1/CerbosPlaygroundServiceClient.php index ceb2fd5..8af670c 100644 --- a/src/Cerbos/Svc/V1/CerbosPlaygroundServiceClient.php +++ b/src/Cerbos/Svc/V1/CerbosPlaygroundServiceClient.php @@ -2,7 +2,7 @@ // GENERATED CODE -- DO NOT EDIT! // Original file comments: -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 // namespace Cerbos\Svc\V1; diff --git a/src/Cerbos/Svc/V1/CerbosServiceClient.php b/src/Cerbos/Svc/V1/CerbosServiceClient.php index fc650bf..f812973 100644 --- a/src/Cerbos/Svc/V1/CerbosServiceClient.php +++ b/src/Cerbos/Svc/V1/CerbosServiceClient.php @@ -2,7 +2,7 @@ // GENERATED CODE -- DO NOT EDIT! // Original file comments: -// Copyright 2021-2023 Zenauth Ltd. +// Copyright 2021-2024 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 // namespace Cerbos\Svc\V1; diff --git a/src/GPBMetadata/Buf/Validate/Validate.php b/src/GPBMetadata/Buf/Validate/Validate.php index 8c1b4dea9622be67913f7bee83a7efe56410d867..024e82f882e721c4dd0de60406673c215221d986 100644 GIT binary patch delta 743 zcmdnq#{9U4dBY|q)_MP!xTGg~OK-l!#L>m{LS^%vo(>+nMn*2d%!2sx%#w`wf}+&4 z%!-`UJP9cUMhy<9;6ok(Tz*^<#U(|VdFgr>%7o-6f1EB>?-`%~(J3WZl95@gms#vt z5CAqxL(_vHh(EI+9B4X31ZcR>JVq|z%z`o#bW5edmgXGt$mB}rl7d@`p-{-QEHS4v zRUx;uxI`f-b@IRIoRfb{?Mb1)xRgB^gpe=q@q=ISJ_FG83$hGDCNi3=T)3 zD-<#Xg~jB)#XMO=xx)internalAddGeneratedFile( ' -X -!cerbos/response/v1/response.protocerbos.response.v1cerbos/effect/v1/effect.protocerbos/engine/v1/engine.protocerbos/policy/v1/policy.protocerbos/schema/v1/schema.protogoogle/protobuf/empty.proto.protoc-gen-openapiv2/options/annotations.proto" +Z +!cerbos/response/v1/response.protocerbos.response.v1cerbos/effect/v1/effect.protocerbos/engine/v1/engine.protocerbos/policy/v1/policy.protocerbos/schema/v1/schema.protogoogle/protobuf/empty.proto.protoc-gen-openapiv2/options/annotations.proto" PlanResourcesResponseo request_id ( BPAM2#Request ID provided in the request.J&"c2db17b8-4f9f-4fb1-acfd-9162a02be42b"R requestId2 @@ -33,7 +33,8 @@ public static function initOnce() { policy_version ( B#A 2The policy version.J "default"R policyVersionJ filter ( 2%.cerbos.engine.v1.PlanResourcesFilterB A2FilterRfilter meta ( 2..cerbos.response.v1.PlanResourcesResponse.MetaB;A826Optional metadata about the request evaluation processRmeta -validation_errors ( 2!.cerbos.schema.v1.ValidationErrorB@A=2;List of validation errors (if schema validation is enabled)RvalidationErrors +validation_errors ( 2!.cerbos.schema.v1.ValidationErrorB@A=2;List of validation errors (if schema validation is enabled)RvalidationErrorsY +cerbos_call_id ( B3A02.Audit log call ID associated with this requestR cerbosCallId Meta] filter_debug ( B:A725Filter textual representation for debugging purposes.R filterDebugm matched_scope ( BHAE21Policy scope that matched to produce this effect.J"acme.corp.base"R matchedScope:)A& @@ -85,11 +86,12 @@ public static function initOnce() { ActionsEntry key ( Rkey. value (2.cerbos.effect.v1.EffectRvalue:8:;A8 -624Policy evaluation response for a batch of resources." +624Policy evaluation response for a batch of resources." CheckResourcesResponseo request_id ( BPAM2#Request ID provided in the request.J&"c2db17b8-4f9f-4fb1-acfd-9162a02be42b"R requestId -results ( 26.cerbos.response.v1.CheckResourcesResponse.ResultEntryBA2Result for each resourceJp[{"resource": {"Id":"XX125", "kind":"album:object"}, "actions":{"view":"EFFECT_ALLOW","comment":"EFFECT_DENY"}}]Rresults +results ( 26.cerbos.response.v1.CheckResourcesResponse.ResultEntryBA2Result for each resourceJp[{"resource": {"Id":"XX125", "kind":"album:object"}, "actions":{"view":"EFFECT_ALLOW","comment":"EFFECT_DENY"}}]RresultsY +cerbos_call_id ( B3A02.Audit log call ID associated with this requestR cerbosCallId ResultEntry[ resource ( 2?.cerbos.response.v1.CheckResourcesResponse.ResultEntry.ResourceRresource actions ( 2C.cerbos.response.v1.CheckResourcesResponse.ResultEntry.ActionsEntryBBA?2$Mapping of each action to an effect.J{"view":"EFFECT_ALLOW"}Ractions diff --git a/src/Sdk/Builder/AttributeValue.php b/src/Sdk/Builder/AttributeValue.php index 0569eb8..63fb0f7 100644 --- a/src/Sdk/Builder/AttributeValue.php +++ b/src/Sdk/Builder/AttributeValue.php @@ -1,6 +1,6 @@