/*
 * Internal Utility API
 * This API allows you to access internal data.
 *
 * OpenAPI spec version: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package org.wso2.am.integration.clients.internal.api.dto;

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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.wso2.am.integration.clients.internal.api.dto.GatewayPropertiesDTO;

/**
 * NotifyGatewayPayloadDTO
 */

public class NotifyGatewayPayloadDTO {
  /**
   * Indicates the type of payload. - \&quot;REGISTER\&quot;: Gateway registration payload - \&quot;HEARTBEAT\&quot;: Heartbeat update payload 
   */
  @JsonAdapter(PayloadTypeEnum.Adapter.class)
  public enum PayloadTypeEnum {
    REGISTER("REGISTER"),
    
    HEARTBEAT("HEARTBEAT");

    private String value;

    PayloadTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static PayloadTypeEnum fromValue(String text) {
      for (PayloadTypeEnum b : PayloadTypeEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

    public static class Adapter extends TypeAdapter<PayloadTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final PayloadTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public PayloadTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value = jsonReader.nextString();
        return PayloadTypeEnum.fromValue(String.valueOf(value));
      }
    }
  }

  @SerializedName("payloadType")
  private PayloadTypeEnum payloadType = null;

  @SerializedName("gatewayProperties")
  private GatewayPropertiesDTO gatewayProperties = null;

  @SerializedName("loadingTenants")
  private List<String> loadingTenants = null;

  @SerializedName("environmentLabels")
  private List<String> environmentLabels = null;

  @SerializedName("gatewayId")
  private String gatewayId = null;

  @SerializedName("timeStamp")
  private Long timeStamp = null;

  public NotifyGatewayPayloadDTO payloadType(PayloadTypeEnum payloadType) {
    this.payloadType = payloadType;
    return this;
  }

   /**
   * Indicates the type of payload. - \&quot;REGISTER\&quot;: Gateway registration payload - \&quot;HEARTBEAT\&quot;: Heartbeat update payload 
   * @return payloadType
  **/
  @ApiModelProperty(example = "REGISTER", required = true, value = "Indicates the type of payload. - \"REGISTER\": Gateway registration payload - \"HEARTBEAT\": Heartbeat update payload ")
  public PayloadTypeEnum getPayloadType() {
    return payloadType;
  }

  public void setPayloadType(PayloadTypeEnum payloadType) {
    this.payloadType = payloadType;
  }

  public NotifyGatewayPayloadDTO gatewayProperties(GatewayPropertiesDTO gatewayProperties) {
    this.gatewayProperties = gatewayProperties;
    return this;
  }

   /**
   * Get gatewayProperties
   * @return gatewayProperties
  **/
  @ApiModelProperty(value = "")
  public GatewayPropertiesDTO getGatewayProperties() {
    return gatewayProperties;
  }

  public void setGatewayProperties(GatewayPropertiesDTO gatewayProperties) {
    this.gatewayProperties = gatewayProperties;
  }

  public NotifyGatewayPayloadDTO loadingTenants(List<String> loadingTenants) {
    this.loadingTenants = loadingTenants;
    return this;
  }

  public NotifyGatewayPayloadDTO addLoadingTenantsItem(String loadingTenantsItem) {
    if (this.loadingTenants == null) {
      this.loadingTenants = new ArrayList<>();
    }
    this.loadingTenants.add(loadingTenantsItem);
    return this;
  }

   /**
   * List of tenant names
   * @return loadingTenants
  **/
  @ApiModelProperty(example = "[\"tenant1.com\",\"tenant2.org\",\"carbon.super\"]", value = "List of tenant names")
  public List<String> getLoadingTenants() {
    return loadingTenants;
  }

  public void setLoadingTenants(List<String> loadingTenants) {
    this.loadingTenants = loadingTenants;
  }

  public NotifyGatewayPayloadDTO environmentLabels(List<String> environmentLabels) {
    this.environmentLabels = environmentLabels;
    return this;
  }

  public NotifyGatewayPayloadDTO addEnvironmentLabelsItem(String environmentLabelsItem) {
    if (this.environmentLabels == null) {
      this.environmentLabels = new ArrayList<>();
    }
    this.environmentLabels.add(environmentLabelsItem);
    return this;
  }

   /**
   * A list of environments this gateway supports.
   * @return environmentLabels
  **/
  @ApiModelProperty(example = "[\"default\",\"production\",\"sandbox\"]", value = "A list of environments this gateway supports.")
  public List<String> getEnvironmentLabels() {
    return environmentLabels;
  }

  public void setEnvironmentLabels(List<String> environmentLabels) {
    this.environmentLabels = environmentLabels;
  }

  public NotifyGatewayPayloadDTO gatewayId(String gatewayId) {
    this.gatewayId = gatewayId;
    return this;
  }

   /**
   * The unique identifier assigned to the newly registered gateway.
   * @return gatewayId
  **/
  @ApiModelProperty(value = "The unique identifier assigned to the newly registered gateway.")
  public String getGatewayId() {
    return gatewayId;
  }

  public void setGatewayId(String gatewayId) {
    this.gatewayId = gatewayId;
  }

  public NotifyGatewayPayloadDTO timeStamp(Long timeStamp) {
    this.timeStamp = timeStamp;
    return this;
  }

   /**
   * The timestamp when the heartbeat was generated.
   * @return timeStamp
  **/
  @ApiModelProperty(value = "The timestamp when the heartbeat was generated.")
  public Long getTimeStamp() {
    return timeStamp;
  }

  public void setTimeStamp(Long timeStamp) {
    this.timeStamp = timeStamp;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    NotifyGatewayPayloadDTO notifyGatewayPayload = (NotifyGatewayPayloadDTO) o;
    return Objects.equals(this.payloadType, notifyGatewayPayload.payloadType) &&
        Objects.equals(this.gatewayProperties, notifyGatewayPayload.gatewayProperties) &&
        Objects.equals(this.loadingTenants, notifyGatewayPayload.loadingTenants) &&
        Objects.equals(this.environmentLabels, notifyGatewayPayload.environmentLabels) &&
        Objects.equals(this.gatewayId, notifyGatewayPayload.gatewayId) &&
        Objects.equals(this.timeStamp, notifyGatewayPayload.timeStamp);
  }

  @Override
  public int hashCode() {
    return Objects.hash(payloadType, gatewayProperties, loadingTenants, environmentLabels, gatewayId, timeStamp);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class NotifyGatewayPayloadDTO {\n");
    
    sb.append("    payloadType: ").append(toIndentedString(payloadType)).append("\n");
    sb.append("    gatewayProperties: ").append(toIndentedString(gatewayProperties)).append("\n");
    sb.append("    loadingTenants: ").append(toIndentedString(loadingTenants)).append("\n");
    sb.append("    environmentLabels: ").append(toIndentedString(environmentLabels)).append("\n");
    sb.append("    gatewayId: ").append(toIndentedString(gatewayId)).append("\n");
    sb.append("    timeStamp: ").append(toIndentedString(timeStamp)).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    ");
  }

}

