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