001package com.box.sdkgen.schemas.timelineskillcard;
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@JsonFilter("nullablePropertyFilter")
013public class TimelineSkillCardInvocationField extends SerializableObject {
014
015  /** The value will always be `skill_invocation`. */
016  @JsonDeserialize(
017      using =
018          TimelineSkillCardInvocationTypeField.TimelineSkillCardInvocationTypeFieldDeserializer
019              .class)
020  @JsonSerialize(
021      using =
022          TimelineSkillCardInvocationTypeField.TimelineSkillCardInvocationTypeFieldSerializer.class)
023  protected EnumWrapper<TimelineSkillCardInvocationTypeField> type;
024
025  /**
026   * A custom identifier that represent the instance of the service that applied this metadata. For
027   * example, if your `image-recognition-service` runs on multiple nodes, this field can be used to
028   * identify the ID of the node that was used to apply the metadata.
029   */
030  protected final String id;
031
032  public TimelineSkillCardInvocationField(@JsonProperty("id") String id) {
033    super();
034    this.id = id;
035    this.type =
036        new EnumWrapper<TimelineSkillCardInvocationTypeField>(
037            TimelineSkillCardInvocationTypeField.SKILL_INVOCATION);
038  }
039
040  protected TimelineSkillCardInvocationField(Builder builder) {
041    super();
042    this.type = builder.type;
043    this.id = builder.id;
044    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
045  }
046
047  public EnumWrapper<TimelineSkillCardInvocationTypeField> getType() {
048    return type;
049  }
050
051  public String getId() {
052    return id;
053  }
054
055  @Override
056  public boolean equals(Object o) {
057    if (this == o) {
058      return true;
059    }
060    if (o == null || getClass() != o.getClass()) {
061      return false;
062    }
063    TimelineSkillCardInvocationField casted = (TimelineSkillCardInvocationField) o;
064    return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
065  }
066
067  @Override
068  public int hashCode() {
069    return Objects.hash(type, id);
070  }
071
072  @Override
073  public String toString() {
074    return "TimelineSkillCardInvocationField{"
075        + "type='"
076        + type
077        + '\''
078        + ", "
079        + "id='"
080        + id
081        + '\''
082        + "}";
083  }
084
085  public static class Builder extends NullableFieldTracker {
086
087    protected EnumWrapper<TimelineSkillCardInvocationTypeField> type;
088
089    protected final String id;
090
091    public Builder(String id) {
092      super();
093      this.id = id;
094    }
095
096    public Builder type(TimelineSkillCardInvocationTypeField type) {
097      this.type = new EnumWrapper<TimelineSkillCardInvocationTypeField>(type);
098      return this;
099    }
100
101    public Builder type(EnumWrapper<TimelineSkillCardInvocationTypeField> type) {
102      this.type = type;
103      return this;
104    }
105
106    public TimelineSkillCardInvocationField build() {
107      if (this.type == null) {
108        this.type =
109            new EnumWrapper<TimelineSkillCardInvocationTypeField>(
110                TimelineSkillCardInvocationTypeField.SKILL_INVOCATION);
111      }
112      return new TimelineSkillCardInvocationField(this);
113    }
114  }
115}