// 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.productregistry.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";

option csharp_namespace = "Google.Cloud.ProductRegistry.V1";
option go_package = "cloud.google.com/go/productregistry/apiv1/productregistrypb;productregistrypb";
option java_multiple_files = true;
option java_outer_classname = "ProductSuiteProto";
option java_package = "com.google.cloud.productregistry.v1";
option php_namespace = "Google\\Cloud\\ProductRegistry\\V1";
option ruby_package = "Google::Cloud::ProductRegistry::V1";

// Represents a unified grouping of products sharing a common brand and market
// positioning.
message ProductSuite {
  option (google.api.resource) = {
    type: "cloudproductregistry.googleapis.com/ProductSuite"
    pattern: "productSuites/{product_suite}"
    plural: "productSuites"
    singular: "productSuite"
  };

  // Identifier. The resource name of the ProductSuite.
  // Format: productSuites/{product_suite}
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Title of the ProductSuite.
  string title = 2;

  // Output only. LogicalProducts under this suite.
  // Format: logicalProducts/{logical_product}
  repeated string logical_products = 3 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "cloudproductregistry.googleapis.com/LogicalProduct"
    }
  ];

  // Output only. Indicates whether the product suite has been replaced. If
  // `false`, the product suite is active. If `true`, the product suite has been
  // replaced by another type, and the `replacement` field contains the resource
  // name of that replacement.
  bool replaced = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The resource name of the Logical Entity that the product suite
  // is replaced by. This field is only populated when this product suite is
  // replaced by some other type. Eg: logicalProducts/{logical_product},
  // logicalProducts/{logical_product}/variants/{variant}, etc.
  string replacement = 5 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = { type: "*" }
  ];
}
