/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudtasks.v2beta2.model;

/**
 * Statistics for a queue.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Tasks API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class QueueStats extends com.google.api.client.json.GenericJson {

  /**
   * Output only. The number of requests that the queue has dispatched but has not received a reply
   * for yet.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long concurrentDispatchesCount;

  /**
   * Output only. The current maximum number of tasks per second executed by the queue. The maximum
   * value of this variable is controlled by the RateLimits of the Queue. However, this value could
   * be less to avoid overloading the endpoints tasks in the queue are targeting.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double effectiveExecutionRate;

  /**
   * Output only. The number of tasks that the queue has dispatched and received a reply for during
   * the last minute. This variable counts both successful and non-successful executions.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long executedLastMinuteCount;

  /**
   * Output only. An estimation of the nearest time in the future where a task in the queue is
   * scheduled to be executed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String oldestEstimatedArrivalTime;

  /**
   * Output only. An estimation of the number of tasks in the queue, that is, the tasks in the queue
   * that haven't been executed, the tasks in the queue which the queue has dispatched but has not
   * yet received a reply for, and the failed tasks that the queue is retrying.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long tasksCount;

  /**
   * Output only. The number of requests that the queue has dispatched but has not received a reply
   * for yet.
   * @return value or {@code null} for none
   */
  public java.lang.Long getConcurrentDispatchesCount() {
    return concurrentDispatchesCount;
  }

  /**
   * Output only. The number of requests that the queue has dispatched but has not received a reply
   * for yet.
   * @param concurrentDispatchesCount concurrentDispatchesCount or {@code null} for none
   */
  public QueueStats setConcurrentDispatchesCount(java.lang.Long concurrentDispatchesCount) {
    this.concurrentDispatchesCount = concurrentDispatchesCount;
    return this;
  }

  /**
   * Output only. The current maximum number of tasks per second executed by the queue. The maximum
   * value of this variable is controlled by the RateLimits of the Queue. However, this value could
   * be less to avoid overloading the endpoints tasks in the queue are targeting.
   * @return value or {@code null} for none
   */
  public java.lang.Double getEffectiveExecutionRate() {
    return effectiveExecutionRate;
  }

  /**
   * Output only. The current maximum number of tasks per second executed by the queue. The maximum
   * value of this variable is controlled by the RateLimits of the Queue. However, this value could
   * be less to avoid overloading the endpoints tasks in the queue are targeting.
   * @param effectiveExecutionRate effectiveExecutionRate or {@code null} for none
   */
  public QueueStats setEffectiveExecutionRate(java.lang.Double effectiveExecutionRate) {
    this.effectiveExecutionRate = effectiveExecutionRate;
    return this;
  }

  /**
   * Output only. The number of tasks that the queue has dispatched and received a reply for during
   * the last minute. This variable counts both successful and non-successful executions.
   * @return value or {@code null} for none
   */
  public java.lang.Long getExecutedLastMinuteCount() {
    return executedLastMinuteCount;
  }

  /**
   * Output only. The number of tasks that the queue has dispatched and received a reply for during
   * the last minute. This variable counts both successful and non-successful executions.
   * @param executedLastMinuteCount executedLastMinuteCount or {@code null} for none
   */
  public QueueStats setExecutedLastMinuteCount(java.lang.Long executedLastMinuteCount) {
    this.executedLastMinuteCount = executedLastMinuteCount;
    return this;
  }

  /**
   * Output only. An estimation of the nearest time in the future where a task in the queue is
   * scheduled to be executed.
   * @return value or {@code null} for none
   */
  public String getOldestEstimatedArrivalTime() {
    return oldestEstimatedArrivalTime;
  }

  /**
   * Output only. An estimation of the nearest time in the future where a task in the queue is
   * scheduled to be executed.
   * @param oldestEstimatedArrivalTime oldestEstimatedArrivalTime or {@code null} for none
   */
  public QueueStats setOldestEstimatedArrivalTime(String oldestEstimatedArrivalTime) {
    this.oldestEstimatedArrivalTime = oldestEstimatedArrivalTime;
    return this;
  }

  /**
   * Output only. An estimation of the number of tasks in the queue, that is, the tasks in the queue
   * that haven't been executed, the tasks in the queue which the queue has dispatched but has not
   * yet received a reply for, and the failed tasks that the queue is retrying.
   * @return value or {@code null} for none
   */
  public java.lang.Long getTasksCount() {
    return tasksCount;
  }

  /**
   * Output only. An estimation of the number of tasks in the queue, that is, the tasks in the queue
   * that haven't been executed, the tasks in the queue which the queue has dispatched but has not
   * yet received a reply for, and the failed tasks that the queue is retrying.
   * @param tasksCount tasksCount or {@code null} for none
   */
  public QueueStats setTasksCount(java.lang.Long tasksCount) {
    this.tasksCount = tasksCount;
    return this;
  }

  @Override
  public QueueStats set(String fieldName, Object value) {
    return (QueueStats) super.set(fieldName, value);
  }

  @Override
  public QueueStats clone() {
    return (QueueStats) super.clone();
  }

}
