/*
 * ThingPark things management Devices API
 * REST interface for Devices management. 
 *
 * The version of the OpenAPI document: 7.3
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package lora.ns.actility.api.model.appserver;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * AppServersRoutingProfileCellular
 */
@JsonPropertyOrder({ AppServersRoutingProfileCellular.JSON_PROPERTY_TYPE,
    AppServersRoutingProfileCellular.JSON_PROPERTY_MODE, AppServersRoutingProfileCellular.JSON_PROPERTY_GTP_TUNNEL,
    AppServersRoutingProfileCellular.JSON_PROPERTY_GRE_TUNNELS,
    AppServersRoutingProfileCellular.JSON_PROPERTY_MESSAGE_ROUTING,
    AppServersRoutingProfileCellular.JSON_PROPERTY_APP_SERVERS_REPORTING })
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-05-29T11:38:36.048437806+02:00[Europe/Paris]", comments = "Generator version: 7.6.0")
public class AppServersRoutingProfileCellular {
  /**
   * AS routing profile type (&#x60;LORAWAN&#x60; or &#x60;CELLULAR&#x60;)
   * &#x60;CELLULAR&#x60; is only applicable to **ThingPark Wireless** if the
   * cellular connectivity is enabled by the Operator.
   */
  public enum TypeEnum {
    CELLULAR("CELLULAR");

    private String value;

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

    @JsonValue
    public String getValue() {
      return value;
    }

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

    @JsonCreator
    public static TypeEnum fromValue(String value) {
      for (TypeEnum b : TypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_TYPE = "type";
  private TypeEnum type;

  /**
   * AS routing profile mode (MIXED, MESSAGE or DIRECT_IP)
   */
  public enum ModeEnum {
    MIXED("MIXED"),

    MESSAGE("MESSAGE"),

    DIRECT_IP("DIRECT_IP");

    private String value;

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

    @JsonValue
    public String getValue() {
      return value;
    }

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

    @JsonCreator
    public static ModeEnum fromValue(String value) {
      for (ModeEnum b : ModeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_MODE = "mode";
  private ModeEnum mode = ModeEnum.MESSAGE;

  public static final String JSON_PROPERTY_GTP_TUNNEL = "gtpTunnel";
  private AppServersRoutingProfileCellularGtpTunnel gtpTunnel;

  public static final String JSON_PROPERTY_GRE_TUNNELS = "greTunnels";
  private List<AppServersRoutingProfileCellularGreTunnelsInner> greTunnels = new ArrayList<>();

  public static final String JSON_PROPERTY_MESSAGE_ROUTING = "messageRouting";
  private AppServersRoutingProfileCellularMessageRouting messageRouting;

  public static final String JSON_PROPERTY_APP_SERVERS_REPORTING = "appServersReporting";
  private AppServersRoutingProfileCellularAppServersReporting appServersReporting;

  public AppServersRoutingProfileCellular() {
  }

  public AppServersRoutingProfileCellular type(TypeEnum type) {

    this.type = type;
    return this;
  }

  /**
   * AS routing profile type (&#x60;LORAWAN&#x60; or &#x60;CELLULAR&#x60;)
   * &#x60;CELLULAR&#x60; is only applicable to **ThingPark Wireless** if the
   * cellular connectivity is enabled by the Operator.
   * 
   * @return type
   **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public TypeEnum getType() {
    return type;
  }

  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setType(TypeEnum type) {
    this.type = type;
  }

  public AppServersRoutingProfileCellular mode(ModeEnum mode) {

    this.mode = mode;
    return this;
  }

  /**
   * AS routing profile mode (MIXED, MESSAGE or DIRECT_IP)
   * 
   * @return mode
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public ModeEnum getMode() {
    return mode;
  }

  @JsonProperty(JSON_PROPERTY_MODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMode(ModeEnum mode) {
    this.mode = mode;
  }

  public AppServersRoutingProfileCellular gtpTunnel(AppServersRoutingProfileCellularGtpTunnel gtpTunnel) {

    this.gtpTunnel = gtpTunnel;
    return this;
  }

  /**
   * Get gtpTunnel
   * 
   * @return gtpTunnel
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_GTP_TUNNEL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public AppServersRoutingProfileCellularGtpTunnel getGtpTunnel() {
    return gtpTunnel;
  }

  @JsonProperty(JSON_PROPERTY_GTP_TUNNEL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setGtpTunnel(AppServersRoutingProfileCellularGtpTunnel gtpTunnel) {
    this.gtpTunnel = gtpTunnel;
  }

  public AppServersRoutingProfileCellular greTunnels(List<AppServersRoutingProfileCellularGreTunnelsInner> greTunnels) {

    this.greTunnels = greTunnels;
    return this;
  }

  public AppServersRoutingProfileCellular addGreTunnelsItem(
          AppServersRoutingProfileCellularGreTunnelsInner greTunnelsItem) {
    if (this.greTunnels == null) {
      this.greTunnels = new ArrayList<>();
    }
    this.greTunnels.add(greTunnelsItem);
    return this;
  }

  /**
   * Get greTunnels
   * 
   * @return greTunnels
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_GRE_TUNNELS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<AppServersRoutingProfileCellularGreTunnelsInner> getGreTunnels() {
    return greTunnels;
  }

  @JsonProperty(JSON_PROPERTY_GRE_TUNNELS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setGreTunnels(List<AppServersRoutingProfileCellularGreTunnelsInner> greTunnels) {
    this.greTunnels = greTunnels;
  }

  public AppServersRoutingProfileCellular messageRouting(
          AppServersRoutingProfileCellularMessageRouting messageRouting) {

    this.messageRouting = messageRouting;
    return this;
  }

  /**
   * Get messageRouting
   * 
   * @return messageRouting
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MESSAGE_ROUTING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public AppServersRoutingProfileCellularMessageRouting getMessageRouting() {
    return messageRouting;
  }

  @JsonProperty(JSON_PROPERTY_MESSAGE_ROUTING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMessageRouting(AppServersRoutingProfileCellularMessageRouting messageRouting) {
    this.messageRouting = messageRouting;
  }

  public AppServersRoutingProfileCellular appServersReporting(
          AppServersRoutingProfileCellularAppServersReporting appServersReporting) {

    this.appServersReporting = appServersReporting;
    return this;
  }

  /**
   * Get appServersReporting
   * 
   * @return appServersReporting
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_APP_SERVERS_REPORTING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public AppServersRoutingProfileCellularAppServersReporting getAppServersReporting() {
    return appServersReporting;
  }

  @JsonProperty(JSON_PROPERTY_APP_SERVERS_REPORTING)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAppServersReporting(AppServersRoutingProfileCellularAppServersReporting appServersReporting) {
    this.appServersReporting = appServersReporting;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AppServersRoutingProfileCellular appServersRoutingProfileCellular = (AppServersRoutingProfileCellular) o;
    return Objects.equals(this.type, appServersRoutingProfileCellular.type)
            && Objects.equals(this.mode, appServersRoutingProfileCellular.mode)
            && Objects.equals(this.gtpTunnel, appServersRoutingProfileCellular.gtpTunnel)
            && Objects.equals(this.greTunnels, appServersRoutingProfileCellular.greTunnels)
            && Objects.equals(this.messageRouting, appServersRoutingProfileCellular.messageRouting)
            && Objects.equals(this.appServersReporting, appServersRoutingProfileCellular.appServersReporting);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, mode, gtpTunnel, greTunnels, messageRouting, appServersReporting);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AppServersRoutingProfileCellular {\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    mode: ").append(toIndentedString(mode)).append("\n");
    sb.append("    gtpTunnel: ").append(toIndentedString(gtpTunnel)).append("\n");
    sb.append("    greTunnels: ").append(toIndentedString(greTunnels)).append("\n");
    sb.append("    messageRouting: ").append(toIndentedString(messageRouting)).append("\n");
    sb.append("    appServersReporting: ").append(toIndentedString(appServersReporting)).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(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}
