code: public GetMetricDataResult withMessages(MessageData... messages) {
          if (this.messages == null) {
              setMessages(new com.amazonaws.internal.SdkInternalList<MessageData>(messages.length));
          }
          for (MessageData ele : messages) {
              this.messages.add(ele);
          }
          return this;
      }
docs: <p>
  Contains a message about this <code>GetMetricData</code> operation, if the operation results in such a message.
  An example of a message that may be returned is <code>Maximum number of allowed metrics exceeded</code>. If there
  is a message, as much of the operation as possible is still executed.
  </p>
  <p>
  A message appears here only if it is related to the global <code>GetMetricData</code> operation. Any message
  about a specific metric returned by the operation appears in the <code>MetricDataResult</code> object returned
  for that metric.
  </p>
  <p>
  <b>NOTE:</b> This method appends the values to the existing list (if any). Use
  {@link #setMessages(java.util.Collection)} or {@link #withMessages(java.util.Collection)} if you want to override
  the existing values.
  </p>
  
  @param messages
  Contains a message about this <code>GetMetricData</code> operation, if the operation results in such a
  message. An example of a message that may be returned is
  <code>Maximum number of allowed metrics exceeded</code>. If there is a message, as much of the operation
  as possible is still executed.</p>
  <p>
  A message appears here only if it is related to the global <code>GetMetricData</code> operation. Any
  message about a specific metric returned by the operation appears in the <code>MetricDataResult</code>
  object returned for that metric.
  @return Returns a reference to this object so that method calls can be chained together.