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

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

option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "UserStoreProto";
option java_package = "com.google.cloud.discoveryengine.v1beta";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";

// Configures metadata that is used for End User entities.
message UserStore {
  option (google.api.resource) = {
    type: "discoveryengine.googleapis.com/UserStore"
    pattern: "projects/{project}/locations/{location}/userStores/{user_store}"
  };

  // Immutable. The full resource name of the User Store, in the format of
  // `projects/{project}/locations/{location}/userStores/{user_store}`.
  //
  // This field must be a UTF-8 encoded string with a length limit of 1024
  // characters.
  string name = 1 [(google.api.field_behavior) = IMMUTABLE];

  // The display name of the User Store.
  string display_name = 2;

  // Optional. The default subscription
  // [LicenseConfig][google.cloud.discoveryengine.v1beta.LicenseConfig] for the
  // UserStore, if
  // [UserStore.enable_license_auto_register][google.cloud.discoveryengine.v1beta.UserStore.enable_license_auto_register]
  // is true, new users will automatically register under the default
  // subscription.
  //
  // If default
  // [LicenseConfig][google.cloud.discoveryengine.v1beta.LicenseConfig] doesn't
  // have remaining license seats left, new users will not be assigned with
  // license and will be blocked for Vertex AI Search features. This is used if
  // `license_assignment_tier_rules` is not configured.
  string default_license_config = 5 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "discoveryengine.googleapis.com/LicenseConfig"
    }
  ];

  // Optional. Whether to enable license auto register for users in this User
  // Store. If true, new users will automatically register under the default
  // license config as long as the default license config has seats left.
  bool enable_license_auto_register = 6
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether to enable license auto update for users in this User
  // Store. If true, users with expired licenses will automatically be updated
  // to use the default license config as long as the default license config has
  // seats left.
  bool enable_expired_license_auto_update = 7
      [(google.api.field_behavior) = OPTIONAL];
}
