@@ -574,3 +574,148 @@ def _convert_to_grpc(self) -> SherlockLayerService_pb2.UpdateICTFixturesRequest:
574574 for update_fixture in self .update_fixtures :
575575 request .ICTFixtureProperties .append (update_fixture ._convert_to_grpc ())
576576 return request
577+
578+
579+ class MountPointProperties (BaseModel ):
580+ """Contains the properties of a mount point."""
581+
582+ id : str
583+ """ID"""
584+ type : str
585+ """Type"""
586+ shape : str
587+ """Shape type"""
588+ units : str
589+ """Units"""
590+ x : float
591+ """Center X"""
592+ y : float
593+ """Center Y"""
594+ length : float
595+ """Length"""
596+ width : float
597+ """Width"""
598+ diameter : float
599+ """Diameter"""
600+ nodes : str
601+ """Number of nodes"""
602+ rotation : float
603+ """Degrees of rotation"""
604+ side : str
605+ """Side"""
606+ height : float
607+ """Height"""
608+ material : str
609+ """Material"""
610+ boundary : str
611+ """Boundary point(s)"""
612+ constraints : str
613+ """FEA constraints"""
614+ polygon : str
615+ """Coordinates of points"""
616+ state : str
617+ """State"""
618+ chassis_material : str
619+ """Chassis material"""
620+
621+ def _convert_to_grpc (self ) -> SherlockLayerService_pb2 .MountPointProperties :
622+ grpc_mount_point_data = SherlockLayerService_pb2 .MountPointProperties ()
623+
624+ grpc_mount_point_data .ID = self .id
625+ grpc_mount_point_data .type = self .type
626+ grpc_mount_point_data .shape = self .shape
627+ grpc_mount_point_data .units = self .units
628+ grpc_mount_point_data .x = str (self .x )
629+ grpc_mount_point_data .y = str (self .y )
630+ grpc_mount_point_data .length = str (self .length )
631+ grpc_mount_point_data .width = str (self .width )
632+ grpc_mount_point_data .diameter = str (self .diameter )
633+ grpc_mount_point_data .nodes = self .nodes
634+ grpc_mount_point_data .rotation = str (self .rotation )
635+ grpc_mount_point_data .side = self .side
636+ grpc_mount_point_data .height = str (self .height )
637+ grpc_mount_point_data .material = self .material
638+ grpc_mount_point_data .boundary = self .boundary
639+ grpc_mount_point_data .constraints = self .constraints
640+ grpc_mount_point_data .polygon = self .polygon
641+ grpc_mount_point_data .state = self .state
642+ grpc_mount_point_data .chassisMaterial = self .chassis_material
643+
644+ return grpc_mount_point_data
645+
646+ @field_validator ("type" , "shape" , "units" , "side" , "state" )
647+ @classmethod
648+ def str_validation (cls , value : str , info : ValidationInfo ):
649+ """Validate string fields listed."""
650+ return basic_str_validator (value , info .field_name )
651+
652+
653+ class GetMountPointsPropertiesRequest (BaseModel ):
654+ """Return the properties for each mount point given a comma-separated list of mount point ids.""" # noqa: E501
655+
656+ project : str
657+ """Name of the project."""
658+ cca_name : str
659+ """Name of the CCA containing the mount point properties to return."""
660+ mount_point_ids : Optional [str ] = None
661+ """Optional Param: Comma-separated list of mount point ids representing one or more mount
662+ points. If this parameter is not included, then the entire list of mount points
663+ for a given CCA will have their properties returned.
664+ """
665+
666+ @field_validator ("project" , "cca_name" , "mount_point_ids" )
667+ @classmethod
668+ def str_validation (cls , value : str , info : ValidationInfo ):
669+ """Validate string fields listed."""
670+ return basic_str_validator (value , info .field_name )
671+
672+ @field_validator ("mount_point_ids" )
673+ @classmethod
674+ def optional_str_validation (cls , value : Optional [str ], info ):
675+ """Allow the mount_point_ids to not be set, i.e., None."""
676+ return optional_str_validator (value , info .field_name )
677+
678+ def _convert_to_grpc (self ) -> SherlockLayerService_pb2 .GetMountPointsPropertiesRequest :
679+ request = SherlockLayerService_pb2 .GetMountPointsPropertiesRequest ()
680+ request .project = self .project
681+ request .ccaName = self .cca_name
682+ if self .mount_point_ids is not None :
683+ request .mountPointIDs = self .mount_point_ids
684+ return request
685+
686+
687+ class UpdateMountPointsRequest (BaseModel ):
688+ """Contains the properties of a mount point update per project."""
689+
690+ project : str
691+ """Name of the Sherlock project."""
692+ cca_name : str
693+ """Name of the Sherlock CCA."""
694+ mount_points : list [MountPointProperties ]
695+ """List of mount points with their properties to update"""
696+
697+ @field_validator ("project" , "cca_name" )
698+ @classmethod
699+ def str_validation (cls , value : str , info : ValidationInfo ):
700+ """Validate string fields listed."""
701+ return basic_str_validator (value , info .field_name )
702+
703+ @field_validator ("mount_points" )
704+ @classmethod
705+ def list_validation (cls , value : list , info : ValidationInfo ):
706+ """Validate that mount_points is not empty."""
707+ if not value :
708+ raise ValueError (f"{ info .field_name } must contain at least one item." )
709+ return value
710+
711+ def _convert_to_grpc (self ) -> SherlockLayerService_pb2 .UpdateMountPointsRequest :
712+ request = SherlockLayerService_pb2 .UpdateMountPointsRequest ()
713+ request .project = self .project
714+ request .ccaName = self .cca_name
715+ if self .mount_points is not None :
716+ for mount_point in self .mount_points :
717+ request .mountPointsProperties .append (mount_point ._convert_to_grpc ())
718+ else :
719+ raise ValueError ("mount_points is invalid because it is None or empty." )
720+
721+ return request
0 commit comments