syntax = "proto3";

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

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

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

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

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

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

  // Type of scope
  string type = 5;

  // parent_id is the id (primary key in the Scope aggregate) of scope's parent
  // @inject_tag: `gorm:"default:0"`
  string parent_id = 6;

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

  // version allows optimistic locking of the scope
  // @inject_tag: `gorm:"default:null"`
  uint32 version = 8;
}
