code: def serialize_with_sampled_logs(self, logs_limit=-1):
          
  
          return {
              'id': self.id,
              'pathName': self.path_name,
              'name': self.name,
              'isUnregistered': self.is_unregistered,
              'logs': [log.serialize for log in self.sampled_logs(logs_limit)],
              'args': self.args.serialize if self.args is not None else [],
              'commands': [cmd.serialize for cmd in self.commands],
              'snapshots': [cmd.serialize for cmd in self.snapshots],
              'logModifiedAt': self.log_modified_at.isoformat()
          }
docs: serialize a result with up to `logs_limit` logs.
  
          If `logs_limit` is -1, this function will return a result with all its
          logs.