// 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.databasecenter.v1beta;

import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Cloud.DatabaseCenter.V1Beta";
option go_package = "cloud.google.com/go/databasecenter/apiv1beta/databasecenterpb;databasecenterpb";
option java_multiple_files = true;
option java_outer_classname = "AffiliationProto";
option java_package = "com.google.cloud.databasecenter.v1beta";
option php_namespace = "Google\\Cloud\\DatabaseCenter\\V1beta";
option ruby_package = "Google::Cloud::DatabaseCenter::V1beta";

// Affiliation information of a resource
message Affiliation {
  // lineage information of the affiliated resources
  // This captures source, target and process which created the lineage.
  message Lineage {
    // Optional. FQN of source table / column
    string source_fqn = 1 [(google.api.field_behavior) = OPTIONAL];

    // Optional. FQN of target table / column
    string target_fqn = 2 [(google.api.field_behavior) = OPTIONAL];

    // Optional. FQN of process which created the lineage i.e. dataplex,
    // datastream etc.
    string process_fqn = 3 [(google.api.field_behavior) = OPTIONAL];

    // Optional. Type of process which created the lineage.
    ProcessType process_type = 4 [(google.api.field_behavior) = OPTIONAL];
  }

  // Type of process which created the lineage.
  enum ProcessType {
    // Unspecified process type.
    PROCESS_TYPE_UNSPECIFIED = 0;

    // Composer process type.
    COMPOSER = 1;

    // Datastream process type.
    DATASTREAM = 2;

    // Dataflow process type.
    DATAFLOW = 3;

    // Bigquery process type.
    BIGQUERY = 4;

    // Data fusion process type.
    DATA_FUSION = 5;

    // Dataproc process type.
    DATAPROC = 6;
  }

  // Optional. resource id of affiliated resource
  string resource_id = 1 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Full resource name
  string full_resource_name = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Multiple lineages can be created from a resource.
  // For example, a resource can be replicated to multiple target resources.
  // In this case, there will be multiple lineages for the resource, one for
  // each target resource.
  repeated Lineage lineages = 3 [(google.api.field_behavior) = OPTIONAL];
}
