/*
 * ThingPark things management Networks API
 * REST interface for networks 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.basestation;

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.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * BsHost
 */
@JsonPropertyOrder({ BsHost.JSON_PROPERTY_I_D, BsHost.JSON_PROPERTY_ACCESS_RIGHT, BsHost.JSON_PROPERTY_NAME })
@JsonTypeName("Bs_host")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-05-31T16:08:44.630492043+02:00[Europe/Paris]", comments = "Generator version: 7.6.0")
public class BsHost {
  public static final String JSON_PROPERTY_I_D = "ID";
  private String ID;

  /**
   * BS host access right: RO, RW Default: RW when the host &#x3D; owner, RO
   * otherwise.
   */
  public enum AccessRightEnum {
    RO("RO"),

    RW("RW");

    private String value;

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

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

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

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

  public static final String JSON_PROPERTY_ACCESS_RIGHT = "accessRight";
  private AccessRightEnum accessRight;

  public static final String JSON_PROPERTY_NAME = "name";
  private String name;

  public BsHost() {
  }

  @JsonCreator
  public BsHost(@JsonProperty(JSON_PROPERTY_NAME) String name) {
    this();
    this.name = name;
  }

  public BsHost ID(String ID) {

    this.ID = ID;
    return this;
  }

  /**
   * BS host ID Default: The owner
   * 
   * @return ID
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_I_D)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getID() {
    return ID;
  }

  @JsonProperty(JSON_PROPERTY_I_D)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setID(String ID) {
    this.ID = ID;
  }

  public BsHost accessRight(AccessRightEnum accessRight) {

    this.accessRight = accessRight;
    return this;
  }

  /**
   * BS host access right: RO, RW Default: RW when the host &#x3D; owner, RO
   * otherwise.
   * 
   * @return accessRight
   **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ACCESS_RIGHT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public AccessRightEnum getAccessRight() {
    return accessRight;
  }

  @JsonProperty(JSON_PROPERTY_ACCESS_RIGHT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAccessRight(AccessRightEnum accessRight) {
    this.accessRight = accessRight;
  }

  /**
   * BS owner name
   * 
   * @return name
   **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getName() {
    return name;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BsHost bsHost = (BsHost) o;
    return Objects.equals(this.ID, bsHost.ID) && Objects.equals(this.accessRight, bsHost.accessRight)
            && Objects.equals(this.name, bsHost.name);
  }

  @Override
  public int hashCode() {
    return Objects.hash(ID, accessRight, name);
  }

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

}
