// Copyright 2025, ANSYS Inc. Unauthorized use, distribution or duplication is prohibited.
syntax = "proto3";
package ansys.api.discovery.v0.connections.joint;

import "ansys/api/dbu/v0/dbumodels.proto";
import "ansys/api/discovery/v0/discoverymodels.proto";

option csharp_namespace = "Ansys.Api.Discovery.V0.Connections";

service Joint
{
  //Joint condition methods
  rpc CreateJoint(JointCreationRequest) returns (JointCreationResponse);

  rpc ChangeJointSide1Location(ChangeLocationRequest) returns(ChangeResponse);
  rpc ChangeJointSide2Location(ChangeLocationRequest) returns(ChangeResponse);

  rpc ChangeJointType(ChangeJointTypeRequest) returns (ChangeResponse);

}

message JointCreationRequest{
  DoubleSidedScopedCreationData creation_data = 1;
  JointProperties joint_properties = 2;
}

message ChangeJointTypeRequest{
  ansys.api.dbu.v0.EntityIdentifier object_id = 1;
  JointType joint_type = 2;
}

message JointCreationResponse{
  CreationResponse condition_response = 1;
  JointDefinition condition_data = 2;
}

// Joint condition definitions
enum JointType {
  FIXED_JOINT = 0;
  HINGED_JOINT = 1;
  SPHERICAL_JOINT = 2;
}

message JointProperties {
  JointType joint_type = 1;
}

message JointDefinition {
  ansys.api.dbu.v0.PhysicsEntityIdentifier id = 1;
  ansys.api.dbu.v0.PhysicsEntityIdentifier parent_id = 2;
  string label = 3;
  repeated string side1_locations = 4;
  repeated string side2_locations = 5;
  bool suppressed = 6;
  JointProperties joint = 7;
}