001package com.box.sdkgen.managers.comments;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.fasterxml.jackson.annotation.JsonFilter;
006import com.fasterxml.jackson.annotation.JsonProperty;
007import java.util.Objects;
008
009@JsonFilter("nullablePropertyFilter")
010public class CreateCommentRequestBody extends SerializableObject {
011
012  /**
013   * The text of the comment.
014   *
015   * <p>To mention a user, use the `tagged_message` parameter instead.
016   */
017  protected final String message;
018
019  /**
020   * The text of the comment, including `&#64;[user_id:name]` somewhere in the message to mention
021   * another user, which will send them an email notification, letting them know they have been
022   * mentioned.
023   *
024   * <p>The `user_id` is the target user's ID, where the `name` can be any custom phrase. In the Box
025   * UI this name will link to the user's profile.
026   *
027   * <p>If you are not mentioning another user, use `message` instead.
028   */
029  @JsonProperty("tagged_message")
030  protected String taggedMessage;
031
032  /** The item to attach the comment to. */
033  protected final CreateCommentRequestBodyItemField item;
034
035  public CreateCommentRequestBody(
036      @JsonProperty("message") String message,
037      @JsonProperty("item") CreateCommentRequestBodyItemField item) {
038    super();
039    this.message = message;
040    this.item = item;
041  }
042
043  protected CreateCommentRequestBody(Builder builder) {
044    super();
045    this.message = builder.message;
046    this.taggedMessage = builder.taggedMessage;
047    this.item = builder.item;
048    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
049  }
050
051  public String getMessage() {
052    return message;
053  }
054
055  public String getTaggedMessage() {
056    return taggedMessage;
057  }
058
059  public CreateCommentRequestBodyItemField getItem() {
060    return item;
061  }
062
063  @Override
064  public boolean equals(Object o) {
065    if (this == o) {
066      return true;
067    }
068    if (o == null || getClass() != o.getClass()) {
069      return false;
070    }
071    CreateCommentRequestBody casted = (CreateCommentRequestBody) o;
072    return Objects.equals(message, casted.message)
073        && Objects.equals(taggedMessage, casted.taggedMessage)
074        && Objects.equals(item, casted.item);
075  }
076
077  @Override
078  public int hashCode() {
079    return Objects.hash(message, taggedMessage, item);
080  }
081
082  @Override
083  public String toString() {
084    return "CreateCommentRequestBody{"
085        + "message='"
086        + message
087        + '\''
088        + ", "
089        + "taggedMessage='"
090        + taggedMessage
091        + '\''
092        + ", "
093        + "item='"
094        + item
095        + '\''
096        + "}";
097  }
098
099  public static class Builder extends NullableFieldTracker {
100
101    protected final String message;
102
103    protected String taggedMessage;
104
105    protected final CreateCommentRequestBodyItemField item;
106
107    public Builder(String message, CreateCommentRequestBodyItemField item) {
108      super();
109      this.message = message;
110      this.item = item;
111    }
112
113    public Builder taggedMessage(String taggedMessage) {
114      this.taggedMessage = taggedMessage;
115      return this;
116    }
117
118    public CreateCommentRequestBody build() {
119      return new CreateCommentRequestBody(this);
120    }
121  }
122}