// 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 google.cloud.dataplex.v1;

import "google/api/field_behavior.proto";

option go_package = "cloud.google.com/go/dataplex/apiv1/dataplexpb;dataplexpb";
option java_multiple_files = true;
option java_outer_classname = "DataQualityRuleTemplateProto";
option java_package = "com.google.cloud.dataplex.v1";

// DataQualityRuleTemplate represents a template which can be reused across
// multiple data quality rules.
message DataQualityRuleTemplate {
  // Templatized SQL query for data quality rules. It can have parameters that
  // can be substituted with values when a rule is created using this template.
  message Sql {
    // Output only. Templatized SQL query for data quality rules.
    string query = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  }

  // Description of the input parameter. It can include the type(s) supported
  // by the parameter and intended usage. It is for information purposes only
  // and does not affect the behavior of the rule template.
  message ParameterDescription {
    // Output only. Description of the input parameter. It can include the
    // type(s) supported by the parameter and intended usage. It is for
    // information purposes only and does not affect the behavior of the rule
    // template.
    string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. The default value for the parameter if no value is provided.
    string default_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  }

  // Output only. The name of the rule template in the format:
  // `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}`
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The dimension a rule template belongs to. Rule level results
  // are also aggregated at the dimension level.
  string dimension = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Collection of SQLs for data quality rules. Currently only one
  // SQL is supported.
  repeated Sql sql_collection = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Description for input parameters
  map<string, ParameterDescription> input_parameters = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. A list of features or properties supported by this rule
  // template.
  repeated string capabilities = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}
