001package com.box.sdkgen.schemas.v2026r0.automateworkflowreferencev2026r0;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.serialization.json.EnumWrapper;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
009import com.fasterxml.jackson.databind.annotation.JsonSerialize;
010import java.util.Objects;
011
012/** A reference to an Automate workflow. */
013@JsonFilter("nullablePropertyFilter")
014public class AutomateWorkflowReferenceV2026R0 extends SerializableObject {
015
016  /** The identifier for the Automate workflow instance. */
017  protected final String id;
018
019  /** The object type. */
020  @JsonDeserialize(
021      using =
022          AutomateWorkflowReferenceV2026R0TypeField
023              .AutomateWorkflowReferenceV2026R0TypeFieldDeserializer.class)
024  @JsonSerialize(
025      using =
026          AutomateWorkflowReferenceV2026R0TypeField
027              .AutomateWorkflowReferenceV2026R0TypeFieldSerializer.class)
028  protected EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField> type;
029
030  /** The display name for the Automate workflow. */
031  protected String name;
032
033  public AutomateWorkflowReferenceV2026R0(@JsonProperty("id") String id) {
034    super();
035    this.id = id;
036    this.type =
037        new EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField>(
038            AutomateWorkflowReferenceV2026R0TypeField.WORKFLOW);
039  }
040
041  protected AutomateWorkflowReferenceV2026R0(Builder builder) {
042    super();
043    this.id = builder.id;
044    this.type = builder.type;
045    this.name = builder.name;
046    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
047  }
048
049  public String getId() {
050    return id;
051  }
052
053  public EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField> getType() {
054    return type;
055  }
056
057  public String getName() {
058    return name;
059  }
060
061  @Override
062  public boolean equals(Object o) {
063    if (this == o) {
064      return true;
065    }
066    if (o == null || getClass() != o.getClass()) {
067      return false;
068    }
069    AutomateWorkflowReferenceV2026R0 casted = (AutomateWorkflowReferenceV2026R0) o;
070    return Objects.equals(id, casted.id)
071        && Objects.equals(type, casted.type)
072        && Objects.equals(name, casted.name);
073  }
074
075  @Override
076  public int hashCode() {
077    return Objects.hash(id, type, name);
078  }
079
080  @Override
081  public String toString() {
082    return "AutomateWorkflowReferenceV2026R0{"
083        + "id='"
084        + id
085        + '\''
086        + ", "
087        + "type='"
088        + type
089        + '\''
090        + ", "
091        + "name='"
092        + name
093        + '\''
094        + "}";
095  }
096
097  public static class Builder extends NullableFieldTracker {
098
099    protected final String id;
100
101    protected EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField> type;
102
103    protected String name;
104
105    public Builder(String id) {
106      super();
107      this.id = id;
108    }
109
110    public Builder type(AutomateWorkflowReferenceV2026R0TypeField type) {
111      this.type = new EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField>(type);
112      return this;
113    }
114
115    public Builder type(EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField> type) {
116      this.type = type;
117      return this;
118    }
119
120    public Builder name(String name) {
121      this.name = name;
122      return this;
123    }
124
125    public AutomateWorkflowReferenceV2026R0 build() {
126      if (this.type == null) {
127        this.type =
128            new EnumWrapper<AutomateWorkflowReferenceV2026R0TypeField>(
129                AutomateWorkflowReferenceV2026R0TypeField.WORKFLOW);
130      }
131      return new AutomateWorkflowReferenceV2026R0(this);
132    }
133  }
134}