// 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";
import "google/cloud/productregistry/v1/lifecycle_state.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 = "LogicalProductVariantProto";
option java_package = "com.google.cloud.productregistry.v1";
option php_namespace = "Google\\Cloud\\ProductRegistry\\V1";
option ruby_package = "Google::Cloud::ProductRegistry::V1";

// Represents a distinct offering derived from a primary product that retains
// core functionalities but offers specialized features for a specific market
// segment.
message LogicalProductVariant {
  option (google.api.resource) = {
    type: "cloudproductregistry.googleapis.com/LogicalProductVariant"
    pattern: "logicalProducts/{logical_product}/variants/{variant}"
    plural: "logicalProductVariants"
    singular: "logicalProductVariant"
  };

  // Identifier. The resource name of the LogicalProductVariant.
  // Format:
  // logicalProducts/{logical_product}/variants/{variant}
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Display name of the LogicalProductVariant.
  string title = 2;

  // Output only. Current Lifecycle state of the logical product variant.
  LifecycleState lifecycle_state = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Indicates whether the logical product variant has been
  // replaced. If `false`, the variant is active. If `true`, the variant 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 logical
  // product variant is replaced by. This field is only populated when this
  // logical product variant is replaced by some other type. Eg:
  // logicalProducts/{logical_product}, productSuites/{product_suite}, etc.
  string replacement = 5 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = { type: "*" }
  ];
}
