function getOperationMessages(operation) {
  if (!operation) {
    throw new Error('Operation object must be provided.');
  }
  const messages = operation.messages();
  if (messages.isEmpty()) {
    return null;
  }
  return messages.all();
}
Get messages related to the provided operation.
@param {object} operation - The AsyncAPI operation object. 
@throws {Error} If opeartion object is not provided or is invalid.

@returns {null} if there are no messages
@returns messages resulting from operation