// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1

syntax = "proto3";

package controller.storage.target.targettest.store.v1;

import "controller/custom_options/v1/options.proto";
import "controller/storage/timestamp/v1/timestamp.proto";

option go_package = "github.com/hashicorp/boundary/internal/target/targettest/store;store";

message Target {
  // public_id is used to access the targettest.Target via an API
  // @inject_tag: gorm:"primary_key"
  string public_id = 10;

  // project id for the targettest.Target
  // @inject_tag: `gorm:"default:null"`
  string project_id = 20;

  // name is the optional friendly name used to
  // access the targettest.Target via an API
  // @inject_tag: `gorm:"default:null"`
  string name = 30 [(custom_options.v1.mask_mapping) = {
    this: "name"
    that: "name"
  }];

  // description of the targettest.Target
  // @inject_tag: `gorm:"default:null"`
  string description = 40 [(custom_options.v1.mask_mapping) = {
    this: "description"
    that: "description"
  }];

  // create_time from the RDBMS
  // @inject_tag: `gorm:"default:current_timestamp"`
  timestamp.v1.Timestamp create_time = 50;

  // update_time from the RDBMS
  // @inject_tag: `gorm:"default:current_timestamp"`
  timestamp.v1.Timestamp update_time = 60;

  // version allows optimistic locking of the targettest.Target when modifying the
  // targettest.Target
  // @inject_tag: `gorm:"default:null"`
  uint32 version = 70;

  // default port of the targettest.Target
  // @inject_tag: `gorm:"default:null"`
  uint32 default_port = 80 [(custom_options.v1.mask_mapping) = {
    this: "DefaultPort"
    that: "attributes.default_port"
  }];

  // default client port of the tcp.Target
  // @inject_tag: `gorm:"default:null"`
  uint32 default_client_port = 85 [(custom_options.v1.mask_mapping) = {
    this: "DefaultClientPort"
    that: "attributes.default_client_port"
  }];

  // Maximum total lifetime of a created session, in seconds
  // @inject_tag: `gorm:"default:null"`
  uint32 session_max_seconds = 100 [(custom_options.v1.mask_mapping) = {
    this: "SessionMaxSeconds"
    that: "session_max_seconds"
  }];

  // Maximum number of connections in a session
  // @inject_tag: `gorm:"default:null"`
  int32 session_connection_limit = 110 [(custom_options.v1.mask_mapping) = {
    this: "SessionConnectionLimit"
    that: "session_connection_limit"
  }];

  // A boolean expression that allows filtering the workers that can handle a session
  // @inject_tag: `gorm:"default:null"`
  string worker_filter = 120 [(custom_options.v1.mask_mapping) = {
    this: "WorkerFilter"
    that: "worker_filter"
  }];

  // A boolean expression that allows filtering the egress workers that can handle a session
  // @inject_tag: `gorm:"default:null"`
  string egress_worker_filter = 130 [(custom_options.v1.mask_mapping) = {
    this: "EgressWorkerFilter"
    that: "egress_worker_filter"
  }];

  // A boolean expression that allows filtering the ingress workers that can handle a session
  // @inject_tag: `gorm:"default:null"`
  string ingress_worker_filter = 140 [(custom_options.v1.mask_mapping) = {
    this: "IngressWorkerFilter"
    that: "ingress_worker_filter"
  }];
}
