syntax = "proto3";

package controller.storage.iam.store.v1;
option go_package = "github.com/hashicorp/boundary/internal/iam/store;store";

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

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

  // scope id for the group
  // @inject_tag: `gorm:"default:null"`
  string scope_id = 20;

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

  // description of the group
  // @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 group when modifying the group
  // itself and when modifying dependent items like group members.
  // @inject_tag: `gorm:"default:null"`
  uint32 version = 70;
}