content: /*
   * Copyright (c) 2020-2025 Airbyte, Inc., all rights reserved.
   */
  
  package io.airbyte.config;
  
  import com.fasterxml.jackson.annotation.JsonAnyGetter;
  import com.fasterxml.jackson.annotation.JsonAnySetter;
  import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonIgnore;
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyDescription;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonValue;
  import com.fasterxml.jackson.databind.JsonNode;
  import jakarta.annotation.Generated;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  /**
   * FieldTransform
   * <p>
   * Describes the difference in a field between two Streams.
   *
   */
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonPropertyOrder({
    "transformType",
    "fieldName",
    "breaking",
    "addField",
    "removeField",
    "updateFieldSchema"
  })
  @Generated(value = "Generated by jsonSchema2Pojo")
  public class FieldTransform implements Serializable {
  
    /**
     *
     * (Required)
     *
     */
    @JsonProperty("transformType")
    private TransformType transformType;
    /**
     * A field name is a list of strings that form the path to the field. (Required)
     *
     */
    @JsonProperty("fieldName")
    @JsonPropertyDescription("A field name is a list of strings that form the path to the field.")
    private List<String> fieldName = new ArrayList<String>();
    /**
     *
     * (Required)
     *
     */
    @JsonProperty("breaking")
    private Boolean breaking;
    @JsonProperty("addField")
    private JsonNode addField;
    @JsonProperty("removeField")
    private JsonNode removeField;
    /**
     * FieldSchemaUpdate
     * <p>
     *
     *
     */
    @JsonProperty("updateFieldSchema")
    private FieldSchemaUpdate updateFieldSchema;
    @JsonIgnore
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
    private final static long serialVersionUID = -6481247911190890237L;
  
    /**
     *
     * (Required)
     *
     */
    @JsonProperty("transformType")
    public TransformType getTransformType() {
      return transformType;
    }
  
    /**
     *
     * (Required)
     *
     */
    @JsonProperty("transformType")
    public void setTransformType(TransformType transformType) {
      this.transformType = transformType;
    }
  
    public FieldTransform withTransformType(TransformType transformType) {
      this.transformType = transformType;
      return this;
    }
  
    /**
     * A field name is a list of strings that form the path to the field. (Required)
     *
     */
    @JsonProperty("fieldName")
    public List<String> getFieldName() {
      return fieldName;
    }
  
    /**
     * A field name is a list of strings that form the path to the field. (Required)
     *
     */
    @JsonProperty("fieldName")
    public void setFieldName(List<String> fieldName) {
      this.fieldName = fieldName;
    }
  
    public FieldTransform withFieldName(List<String> fieldName) {
      this.fieldName = fieldName;
      return this;
    }
  
    /**
     *
     * (Required)
     *
     */
    @JsonProperty("breaking")
    public Boolean getBreaking() {
      return breaking;
    }
  
    /**
     *
     * (Required)
     *
     */
    @JsonProperty("breaking")
    public void setBreaking(Boolean breaking) {
      this.breaking = breaking;
    }
  
    public FieldTransform withBreaking(Boolean breaking) {
      this.breaking = breaking;
      return this;
    }
  
    @JsonProperty("addField")
    public JsonNode getAddField() {
      return addField;
    }
  
    @JsonProperty("addField")
    public void setAddField(JsonNode addField) {
      this.addField = addField;
    }
  
    public FieldTransform withAddField(JsonNode addField) {
      this.addField = addField;
      return this;
    }
  
    @JsonProperty("removeField")
    public JsonNode getRemoveField() {
      return removeField;
    }
  
    @JsonProperty("removeField")
    public void setRemoveField(JsonNode removeField) {
      this.removeField = removeField;
    }
  
    public FieldTransform withRemoveField(JsonNode removeField) {
      this.removeField = removeField;
      return this;
    }
  
    /**
     * FieldSchemaUpdate
     * <p>
     *
     *
     */
    @JsonProperty("updateFieldSchema")
    public FieldSchemaUpdate getUpdateFieldSchema() {
      return updateFieldSchema;
    }
  
    /**
     * FieldSchemaUpdate
     * <p>
     *
     *
     */
    @JsonProperty("updateFieldSchema")
    public void setUpdateFieldSchema(FieldSchemaUpdate updateFieldSchema) {
      this.updateFieldSchema = updateFieldSchema;
    }
  
    public FieldTransform withUpdateFieldSchema(FieldSchemaUpdate updateFieldSchema) {
      this.updateFieldSchema = updateFieldSchema;
      return this;
    }
  
    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
      return this.additionalProperties;
    }
  
    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
      this.additionalProperties.put(name, value);
    }
  
    public FieldTransform withAdditionalProperty(String name, Object value) {
      this.additionalProperties.put(name, value);
      return this;
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append(FieldTransform.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
      sb.append("transformType");
      sb.append('=');
      sb.append(((this.transformType == null) ? "<null>" : this.transformType));
      sb.append(',');
      sb.append("fieldName");
      sb.append('=');
      sb.append(((this.fieldName == null) ? "<null>" : this.fieldName));
      sb.append(',');
      sb.append("breaking");
      sb.append('=');
      sb.append(((this.breaking == null) ? "<null>" : this.breaking));
      sb.append(',');
      sb.append("addField");
      sb.append('=');
      sb.append(((this.addField == null) ? "<null>" : this.addField));
      sb.append(',');
      sb.append("removeField");
      sb.append('=');
      sb.append(((this.removeField == null) ? "<null>" : this.removeField));
      sb.append(',');
      sb.append("updateFieldSchema");
      sb.append('=');
      sb.append(((this.updateFieldSchema == null) ? "<null>" : this.updateFieldSchema));
      sb.append(',');
      sb.append("additionalProperties");
      sb.append('=');
      sb.append(((this.additionalProperties == null) ? "<null>" : this.additionalProperties));
      sb.append(',');
      if (sb.charAt((sb.length() - 1)) == ',') {
        sb.setCharAt((sb.length() - 1), ']');
      } else {
        sb.append(']');
      }
      return sb.toString();
    }
  
    @Override
    public int hashCode() {
      int result = 1;
      result = ((result * 31) + ((this.updateFieldSchema == null) ? 0 : this.updateFieldSchema.hashCode()));
      result = ((result * 31) + ((this.fieldName == null) ? 0 : this.fieldName.hashCode()));
      result = ((result * 31) + ((this.addField == null) ? 0 : this.addField.hashCode()));
      result = ((result * 31) + ((this.additionalProperties == null) ? 0 : this.additionalProperties.hashCode()));
      result = ((result * 31) + ((this.transformType == null) ? 0 : this.transformType.hashCode()));
      result = ((result * 31) + ((this.removeField == null) ? 0 : this.removeField.hashCode()));
      result = ((result * 31) + ((this.breaking == null) ? 0 : this.breaking.hashCode()));
      return result;
    }
  
    @Override
    public boolean equals(Object other) {
      if (other == this) {
        return true;
      }
      if ((other instanceof FieldTransform) == false) {
        return false;
      }
      FieldTransform rhs = ((FieldTransform) other);
      return ((((((((this.updateFieldSchema == rhs.updateFieldSchema)
          || ((this.updateFieldSchema != null) && this.updateFieldSchema.equals(rhs.updateFieldSchema)))
          && ((this.fieldName == rhs.fieldName) || ((this.fieldName != null) && this.fieldName.equals(rhs.fieldName))))
          && ((this.addField == rhs.addField) || ((this.addField != null) && this.addField.equals(rhs.addField))))
          && ((this.additionalProperties == rhs.additionalProperties)
              || ((this.additionalProperties != null) && this.additionalProperties.equals(rhs.additionalProperties))))
          && ((this.transformType == rhs.transformType) || ((this.transformType != null) && this.transformType.equals(rhs.transformType))))
          && ((this.removeField == rhs.removeField) || ((this.removeField != null) && this.removeField.equals(rhs.removeField))))
          && ((this.breaking == rhs.breaking) || ((this.breaking != null) && this.breaking.equals(rhs.breaking))));
    }
  
    public enum TransformType {
  
      ADD_FIELD("add_field"),
      REMOVE_FIELD("remove_field"),
      UPDATE_FIELD_SCHEMA("update_field_schema");
  
      private final String value;
      private final static Map<String, TransformType> CONSTANTS = new HashMap<String, TransformType>();
  
      static {
        for (TransformType c : values()) {
          CONSTANTS.put(c.value, c);
        }
      }
  
      private TransformType(String value) {
        this.value = value;
      }
  
      @Override
      public String toString() {
        return this.value;
      }
  
      @JsonValue
      public String value() {
        return this.value;
      }
  
      @JsonCreator
      public static TransformType fromValue(String value) {
        TransformType constant = CONSTANTS.get(value);
        if (constant == null) {
          throw new IllegalArgumentException(value);
        } else {
          return constant;
        }
      }
  
    }
  
  }
  