/*
 * lakeFS API
 * lakeFS HTTP API
 *
 * The version of the OpenAPI document: 0.1.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 io.lakefs.clients.api.model;

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;

/**
 * OtfDiffEntry
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class OtfDiffEntry {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp";
  @SerializedName(SERIALIZED_NAME_TIMESTAMP)
  private Integer timestamp;

  public static final String SERIALIZED_NAME_OPERATION = "operation";
  @SerializedName(SERIALIZED_NAME_OPERATION)
  private String operation;

  public static final String SERIALIZED_NAME_OPERATION_CONTENT = "operation_content";
  @SerializedName(SERIALIZED_NAME_OPERATION_CONTENT)
  private Object operationContent;

  /**
   * the operation category (CUD)
   */
  @JsonAdapter(OperationTypeEnum.Adapter.class)
  public enum OperationTypeEnum {
    CREATE("create"),
    
    UPDATE("update"),
    
    DELETE("delete");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_OPERATION_TYPE = "operation_type";
  @SerializedName(SERIALIZED_NAME_OPERATION_TYPE)
  private OperationTypeEnum operationType;


  public OtfDiffEntry id(String id) {
    
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "")

  public String getId() {
    return id;
  }


  public void setId(String id) {
    this.id = id;
  }


  public OtfDiffEntry timestamp(Integer timestamp) {
    
    this.timestamp = timestamp;
    return this;
  }

   /**
   * Get timestamp
   * @return timestamp
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "")

  public Integer getTimestamp() {
    return timestamp;
  }


  public void setTimestamp(Integer timestamp) {
    this.timestamp = timestamp;
  }


  public OtfDiffEntry operation(String operation) {
    
    this.operation = operation;
    return this;
  }

   /**
   * Get operation
   * @return operation
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "")

  public String getOperation() {
    return operation;
  }


  public void setOperation(String operation) {
    this.operation = operation;
  }


  public OtfDiffEntry operationContent(Object operationContent) {
    
    this.operationContent = operationContent;
    return this;
  }

   /**
   * free form content describing the returned operation diff
   * @return operationContent
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "free form content describing the returned operation diff")

  public Object getOperationContent() {
    return operationContent;
  }


  public void setOperationContent(Object operationContent) {
    this.operationContent = operationContent;
  }


  public OtfDiffEntry operationType(OperationTypeEnum operationType) {
    
    this.operationType = operationType;
    return this;
  }

   /**
   * the operation category (CUD)
   * @return operationType
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "the operation category (CUD)")

  public OperationTypeEnum getOperationType() {
    return operationType;
  }


  public void setOperationType(OperationTypeEnum operationType) {
    this.operationType = operationType;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    OtfDiffEntry otfDiffEntry = (OtfDiffEntry) o;
    return Objects.equals(this.id, otfDiffEntry.id) &&
        Objects.equals(this.timestamp, otfDiffEntry.timestamp) &&
        Objects.equals(this.operation, otfDiffEntry.operation) &&
        Objects.equals(this.operationContent, otfDiffEntry.operationContent) &&
        Objects.equals(this.operationType, otfDiffEntry.operationType);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, timestamp, operation, operationContent, operationType);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OtfDiffEntry {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    timestamp: ").append(toIndentedString(timestamp)).append("\n");
    sb.append("    operation: ").append(toIndentedString(operation)).append("\n");
    sb.append("    operationContent: ").append(toIndentedString(operationContent)).append("\n");
    sb.append("    operationType: ").append(toIndentedString(operationType)).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    ");
  }

}

