/*
 * 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;

/**
 * AppServersRoutingProfileLorawan
 */
@JsonPropertyOrder({ AppServersRoutingProfileLorawan.JSON_PROPERTY_TYPE,
    AppServersRoutingProfileLorawan.JSON_PROPERTY_SUPPLIER_APP_SERVERS })
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-05-29T00:40:33.291304975+02:00[Europe/Paris]", comments = "Generator version: 7.5.0")
public class AppServersRoutingProfileLorawan {
  /**
   * 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 {
    LORAWAN("LORAWAN");

    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 = TypeEnum.LORAWAN;

  public static final String JSON_PROPERTY_SUPPLIER_APP_SERVERS = "supplierAppServers";
  private List<AppServersRoutingProfileLorawanSupplierAppServersInner> supplierAppServers = new ArrayList<>();

  public AppServersRoutingProfileLorawan() {
  }

  public AppServersRoutingProfileLorawan 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.Nullable
  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public TypeEnum getType() {
    return type;
  }

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

  public AppServersRoutingProfileLorawan supplierAppServers(
          List<AppServersRoutingProfileLorawanSupplierAppServersInner> supplierAppServers) {

    this.supplierAppServers = supplierAppServers;
    return this;
  }

  public AppServersRoutingProfileLorawan addSupplierAppServersItem(
          AppServersRoutingProfileLorawanSupplierAppServersInner supplierAppServersItem) {
    if (this.supplierAppServers == null) {
      this.supplierAppServers = new ArrayList<>();
    }
    this.supplierAppServers.add(supplierAppServersItem);
    return this;
  }

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

  public List<AppServersRoutingProfileLorawanSupplierAppServersInner> getSupplierAppServers() {
    return supplierAppServers;
  }

  @JsonProperty(JSON_PROPERTY_SUPPLIER_APP_SERVERS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSupplierAppServers(List<AppServersRoutingProfileLorawanSupplierAppServersInner> supplierAppServers) {
    this.supplierAppServers = supplierAppServers;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AppServersRoutingProfileLorawan appServersRoutingProfileLorawan = (AppServersRoutingProfileLorawan) o;
    return Objects.equals(this.type, appServersRoutingProfileLorawan.type)
            && Objects.equals(this.supplierAppServers, appServersRoutingProfileLorawan.supplierAppServers);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, supplierAppServers);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AppServersRoutingProfileLorawan {\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    supplierAppServers: ").append(toIndentedString(supplierAppServers)).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    ");
  }

}
