code: func validateDRACForCreation(d *crimson.DRAC) error {
  	switch {
  	case d == nil:
  		return status.Error(codes.InvalidArgument, "DRAC specification is required")
  	case d.Name == "":
  		return status.Error(codes.InvalidArgument, "hostname is required and must be non-empty")
  	case d.Machine == "":
  		return status.Error(codes.InvalidArgument, "machine is required and must be non-empty")
  	case d.Switch == "":
  		return status.Error(codes.InvalidArgument, "switch is required and must be non-empty")
  	case d.Switchport < 1:
  		return status.Error(codes.InvalidArgument, "switchport must be positive")
  	case d.Vlan != 0:
  		return status.Error(codes.InvalidArgument, "VLAN must not be specified, use IP address instead")
  	default:
  		_, err := common.ParseIPv4(d.Ipv4)
  		if err != nil {
  			return status.Errorf(codes.InvalidArgument, "invalid IPv4 address %q", d.Ipv4)
  		}
  		_, err = common.ParseMAC48(d.MacAddress)
  		if err != nil {
  			return status.Errorf(codes.InvalidArgument, "invalid MAC-48 address %q", d.MacAddress)
  		}
  		return nil
  	}
  }
docs: // validateDRACForCreation validates a DRAC for creation.