// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package pipeline_models.validation;

import "google/protobuf/descriptor.proto";

// Custom options for field validation.
// These options can be used to enforce validation rules at the application level
// via custom code.

extend google.protobuf.FieldOptions {
  // For string: must not be empty.
  // For message: must be set.
  // For repeated: must not be empty.
  bool is_required = 50000;

  // For string: specifies the regular expression pattern the string must match.
  string regex = 50001;

  // For numeric types (int32, int64, float, double): specifies the inclusive minimum value.
  double min_value = 50002;

  // For repeated fields: specifies the minimum number of items.
  uint32 min_items = 50003;

  // For enum fields: specifies that the default value (0) is not allowed.
  bool disallow_zero_enum = 50004;

  // For string: specifies the inclusive minimum length.
  uint32 min_len = 50005;

  // For string: specifies the inclusive maximum length.
  uint32 max_len = 50006;

  // For string: specifies that the string must be a valid cron expression.
  bool is_cron_expression = 50007;

  // For string: specifies that the string must be a valid ISO 8601 timestamp.
  bool is_iso8601_timestamp = 50008;

  // For string: specifies that the string must be a valid ISO 8601 duration.
  bool is_iso8601_duration = 50009;

  // For string: specifies that the string must be a valid IANA timezone.
  bool is_iana_timezone = 50010;

  // For map keys:
  string map_key_regex = 50011;

  // For map values:
  string map_value_regex = 50012;
}
