code: def serialize_message(self, message: SegmentSequence) -> bytes:
          
          if isinstance(message, FinTS3Segment):
              message = SegmentSequence([message])
          if isinstance(message, (list, tuple, Iterable)):
              message = SegmentSequence(list(message))
  
          result = []
  
          for segment in message.segments:
              result.append(self.serialize_segment(segment))
  
          return self.implode_segments(result)
docs: Serialize a message (as SegmentSequence, list of FinTS3Segment, or FinTS3Segment) into a byte array