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