// Proto file representing the base class of objects owned by EDB layout objects

syntax = "proto3";

package ansys.api.edb.v1;

import "ansys/api/edb/v1/edb_messages.proto";

// Enum for layout object types
enum LayoutObjType {
  PRIMITIVE = 0;
  PADSTACK_INST = 1;
  TERM = 2;
  TERM_INST = 3;
  CELL_INST = 4;
  LAYER = 5;
  NET = 6;
  PADSTACK = 7;
  GROUP = 8;
  NET_CLASS = 9;
  CELL = 10;
  DIFFERENTIAL_PAIR = 11;
  PIN_GROUP = 12;
  VOLTAGE_REGULATOR = 13;
  EXTENDED_NET = 14;
  LAYOUT_OBJ_TYPE_COUNT = 15;
  INVALID_LAYOUT_OBJ = -1;
}

// LayoutObj service definition
service LayoutObjService {
  // Gets the layout of the layout object
  rpc GetLayout (LayoutObjTargetMessage) returns (EDBObjMessage) {}
  
  // Delete the layout object
  rpc Delete (LayoutObjTargetMessage) returns (google.protobuf.Empty) {}
  
  // Gets a double product property by product id and attribute id
  rpc GetProductProperty (GetProductPropertyTypeMessage) returns (google.protobuf.StringValue) {}
  
  // Sets a integer property by product id and attribute id
  rpc SetProductProperty (SetProductPropertyTypeMessage) returns (google.protobuf.Empty) {}
  
  // Gets a list of property ids associated with the layout object for the given product
  rpc GetProductPropertyIds (GetProductPropertyIdsTypeMessage) returns (ProductPropertyIdsMessage) {}
}

message LayoutObjTargetMessage {
  EDBObjMessage target = 1;
  LayoutObjType type = 2;
}

message GetProductPropertyTypeMessage {
  GetProductPropertyMessage target = 1;
  LayoutObjType type = 2;
}

message SetProductPropertyTypeMessage {
  SetProductPropertyMessage target = 1;
  LayoutObjType type = 2;
}

message GetProductPropertyIdsTypeMessage {
  GetProductPropertyIdsMessage target = 1;
  LayoutObjType type = 2;
}