/*
 * InfluxDB OSS API Service
 * The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. 
 *
 * OpenAPI spec version: 2.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.influxdb.client.domain;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.influxdb.client.domain.ShardGroupManifest;
import com.influxdb.client.domain.SubscriptionManifest;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * RetentionPolicyManifest
 */

public class RetentionPolicyManifest {
  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_REPLICA_N = "replicaN";
  @SerializedName(SERIALIZED_NAME_REPLICA_N)
  private Integer replicaN;

  public static final String SERIALIZED_NAME_DURATION = "duration";
  @SerializedName(SERIALIZED_NAME_DURATION)
  private Long duration;

  public static final String SERIALIZED_NAME_SHARD_GROUP_DURATION = "shardGroupDuration";
  @SerializedName(SERIALIZED_NAME_SHARD_GROUP_DURATION)
  private Long shardGroupDuration;

  public static final String SERIALIZED_NAME_SHARD_GROUPS = "shardGroups";
  @SerializedName(SERIALIZED_NAME_SHARD_GROUPS)
  private List<ShardGroupManifest> shardGroups = new ArrayList<>();

  public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS)
  private List<SubscriptionManifest> subscriptions = new ArrayList<>();

  public RetentionPolicyManifest name(String name) {
    this.name = name;
    return this;
  }

   /**
   * Get name
   * @return name
  **/
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public RetentionPolicyManifest replicaN(Integer replicaN) {
    this.replicaN = replicaN;
    return this;
  }

   /**
   * Get replicaN
   * @return replicaN
  **/
  public Integer getReplicaN() {
    return replicaN;
  }

  public void setReplicaN(Integer replicaN) {
    this.replicaN = replicaN;
  }

  public RetentionPolicyManifest duration(Long duration) {
    this.duration = duration;
    return this;
  }

   /**
   * Get duration
   * @return duration
  **/
  public Long getDuration() {
    return duration;
  }

  public void setDuration(Long duration) {
    this.duration = duration;
  }

  public RetentionPolicyManifest shardGroupDuration(Long shardGroupDuration) {
    this.shardGroupDuration = shardGroupDuration;
    return this;
  }

   /**
   * Get shardGroupDuration
   * @return shardGroupDuration
  **/
  public Long getShardGroupDuration() {
    return shardGroupDuration;
  }

  public void setShardGroupDuration(Long shardGroupDuration) {
    this.shardGroupDuration = shardGroupDuration;
  }

  public RetentionPolicyManifest shardGroups(List<ShardGroupManifest> shardGroups) {
    this.shardGroups = shardGroups;
    return this;
  }

  public RetentionPolicyManifest addShardGroupsItem(ShardGroupManifest shardGroupsItem) {
    this.shardGroups.add(shardGroupsItem);
    return this;
  }

   /**
   * Get shardGroups
   * @return shardGroups
  **/
  public List<ShardGroupManifest> getShardGroups() {
    return shardGroups;
  }

  public void setShardGroups(List<ShardGroupManifest> shardGroups) {
    this.shardGroups = shardGroups;
  }

  public RetentionPolicyManifest subscriptions(List<SubscriptionManifest> subscriptions) {
    this.subscriptions = subscriptions;
    return this;
  }

  public RetentionPolicyManifest addSubscriptionsItem(SubscriptionManifest subscriptionsItem) {
    this.subscriptions.add(subscriptionsItem);
    return this;
  }

   /**
   * Get subscriptions
   * @return subscriptions
  **/
  public List<SubscriptionManifest> getSubscriptions() {
    return subscriptions;
  }

  public void setSubscriptions(List<SubscriptionManifest> subscriptions) {
    this.subscriptions = subscriptions;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RetentionPolicyManifest retentionPolicyManifest = (RetentionPolicyManifest) o;
    return Objects.equals(this.name, retentionPolicyManifest.name) &&
        Objects.equals(this.replicaN, retentionPolicyManifest.replicaN) &&
        Objects.equals(this.duration, retentionPolicyManifest.duration) &&
        Objects.equals(this.shardGroupDuration, retentionPolicyManifest.shardGroupDuration) &&
        Objects.equals(this.shardGroups, retentionPolicyManifest.shardGroups) &&
        Objects.equals(this.subscriptions, retentionPolicyManifest.subscriptions);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, replicaN, duration, shardGroupDuration, shardGroups, subscriptions);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RetentionPolicyManifest {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    replicaN: ").append(toIndentedString(replicaN)).append("\n");
    sb.append("    duration: ").append(toIndentedString(duration)).append("\n");
    sb.append("    shardGroupDuration: ").append(toIndentedString(shardGroupDuration)).append("\n");
    sb.append("    shardGroups: ").append(toIndentedString(shardGroups)).append("\n");
    sb.append("    subscriptions: ").append(toIndentedString(subscriptions)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

