001package com.box.sdkgen.schemas.workflowmini;
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/**
013 * Box Relay Workflows are objects that represent a named collection of flows.
014 *
015 * <p>You application must be authorized to use the `Manage Box Relay` application scope within the
016 * developer console in order to use this resource.
017 */
018@JsonFilter("nullablePropertyFilter")
019public class WorkflowMini extends SerializableObject {
020
021  /** The unique identifier for the workflow. */
022  protected String id;
023
024  /** The value will always be `workflow`. */
025  @JsonDeserialize(using = WorkflowMiniTypeField.WorkflowMiniTypeFieldDeserializer.class)
026  @JsonSerialize(using = WorkflowMiniTypeField.WorkflowMiniTypeFieldSerializer.class)
027  protected EnumWrapper<WorkflowMiniTypeField> type;
028
029  /** The name of the workflow. */
030  protected String name;
031
032  /** The description for a workflow. */
033  protected String description;
034
035  /** Specifies if this workflow is enabled. */
036  @JsonProperty("is_enabled")
037  protected Boolean isEnabled;
038
039  public WorkflowMini() {
040    super();
041  }
042
043  protected WorkflowMini(Builder builder) {
044    super();
045    this.id = builder.id;
046    this.type = builder.type;
047    this.name = builder.name;
048    this.description = builder.description;
049    this.isEnabled = builder.isEnabled;
050    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
051  }
052
053  public String getId() {
054    return id;
055  }
056
057  public EnumWrapper<WorkflowMiniTypeField> getType() {
058    return type;
059  }
060
061  public String getName() {
062    return name;
063  }
064
065  public String getDescription() {
066    return description;
067  }
068
069  public Boolean getIsEnabled() {
070    return isEnabled;
071  }
072
073  @Override
074  public boolean equals(Object o) {
075    if (this == o) {
076      return true;
077    }
078    if (o == null || getClass() != o.getClass()) {
079      return false;
080    }
081    WorkflowMini casted = (WorkflowMini) o;
082    return Objects.equals(id, casted.id)
083        && Objects.equals(type, casted.type)
084        && Objects.equals(name, casted.name)
085        && Objects.equals(description, casted.description)
086        && Objects.equals(isEnabled, casted.isEnabled);
087  }
088
089  @Override
090  public int hashCode() {
091    return Objects.hash(id, type, name, description, isEnabled);
092  }
093
094  @Override
095  public String toString() {
096    return "WorkflowMini{"
097        + "id='"
098        + id
099        + '\''
100        + ", "
101        + "type='"
102        + type
103        + '\''
104        + ", "
105        + "name='"
106        + name
107        + '\''
108        + ", "
109        + "description='"
110        + description
111        + '\''
112        + ", "
113        + "isEnabled='"
114        + isEnabled
115        + '\''
116        + "}";
117  }
118
119  public static class Builder extends NullableFieldTracker {
120
121    protected String id;
122
123    protected EnumWrapper<WorkflowMiniTypeField> type;
124
125    protected String name;
126
127    protected String description;
128
129    protected Boolean isEnabled;
130
131    public Builder id(String id) {
132      this.id = id;
133      return this;
134    }
135
136    public Builder type(WorkflowMiniTypeField type) {
137      this.type = new EnumWrapper<WorkflowMiniTypeField>(type);
138      return this;
139    }
140
141    public Builder type(EnumWrapper<WorkflowMiniTypeField> type) {
142      this.type = type;
143      return this;
144    }
145
146    public Builder name(String name) {
147      this.name = name;
148      return this;
149    }
150
151    public Builder description(String description) {
152      this.description = description;
153      return this;
154    }
155
156    public Builder isEnabled(Boolean isEnabled) {
157      this.isEnabled = isEnabled;
158      return this;
159    }
160
161    public WorkflowMini build() {
162      return new WorkflowMini(this);
163    }
164  }
165}