001// Generated by delombok at Sun Apr 14 14:59:49 CEST 2024
002/*
003 * Copyright (c) 2010-2024 Mark Allen, Norbert Bartels.
004 *
005 * Permission is hereby granted, free of charge, to any person obtaining a copy
006 * of this software and associated documentation files (the "Software"), to deal
007 * in the Software without restriction, including without limitation the rights
008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009 * copies of the Software, and to permit persons to whom the Software is
010 * furnished to do so, subject to the following conditions:
011 *
012 * The above copyright notice and this permission notice shall be included in
013 * all copies or substantial portions of the Software.
014 *
015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021 * THE SOFTWARE.
022 */
023package com.restfb.types.instagram;
024
025import java.util.ArrayList;
026import java.util.Collections;
027import java.util.Date;
028import java.util.List;
029import com.restfb.Facebook;
030import com.restfb.types.FacebookType;
031
032/**
033 * Represents a <a href="https://developers.facebook.com/docs/instagram-api/reference/comment">Instagram Comment</a>
034 * object
035 */
036public class IgComment extends FacebookType {
037  private static final long serialVersionUID = 1L;
038  /**
039   * Whether the comment is hidden
040   */
041  @Facebook
042  private Boolean hidden;
043  /**
044   * An object containing:
045   *
046   * id — IGSID of the Instagram user who created the IG Comment.
047   * username — Username of the Instagram user who created the IG Comment.
048   */
049  @Facebook
050  private IgFrom from;
051  /**
052   * Number of likes on the comment
053   */
054  @Facebook("like_count")
055  private Long likeCount;
056  /**
057   * Media on which the comment is made
058   */
059  @Facebook
060  private IgMedia media;
061  /**
062   * Text of the comment
063   */
064  @Facebook
065  private String text;
066  /**
067   * Timestamp of comment
068   */
069  @Facebook
070  private Date timestamp;
071  /**
072   * User who made the comment
073   *
074   * @deprecated with Graph API 12 or December 13, 2021 for all versions
075   */
076  @Facebook
077  @Deprecated
078  private IgUser user;
079  /**
080   * User will only be returned when queried by owner of comment. Otherwise, username is the only field that will be
081   * returned.
082   */
083  @Facebook
084  private String username;
085  /**
086   * ID of the parent IG Comment if this comment was created on another IG Comment (i.e. a reply to another comment.
087   */
088  @Facebook("parent_id")
089  private String parentId;
090  @Facebook
091  private List<IgComment> replies = new ArrayList<>();
092
093  public List<IgComment> getReplies() {
094    return Collections.unmodifiableList(replies);
095  }
096
097  public boolean addReply(IgComment reply) {
098    return replies.add(reply);
099  }
100
101  public boolean removeReply(IgComment reply) {
102    return replies.remove(reply);
103  }
104
105  /**
106   * Whether the comment is hidden
107   */
108  @java.lang.SuppressWarnings("all")
109  public Boolean getHidden() {
110    return this.hidden;
111  }
112
113  /**
114   * Whether the comment is hidden
115   */
116  @java.lang.SuppressWarnings("all")
117  public void setHidden(final Boolean hidden) {
118    this.hidden = hidden;
119  }
120
121  /**
122   * An object containing:
123   *
124   * id — IGSID of the Instagram user who created the IG Comment.
125   * username — Username of the Instagram user who created the IG Comment.
126   */
127  @java.lang.SuppressWarnings("all")
128  public IgFrom getFrom() {
129    return this.from;
130  }
131
132  /**
133   * An object containing:
134   *
135   * id — IGSID of the Instagram user who created the IG Comment.
136   * username — Username of the Instagram user who created the IG Comment.
137   */
138  @java.lang.SuppressWarnings("all")
139  public void setFrom(final IgFrom from) {
140    this.from = from;
141  }
142
143  /**
144   * Number of likes on the comment
145   */
146  @java.lang.SuppressWarnings("all")
147  public Long getLikeCount() {
148    return this.likeCount;
149  }
150
151  /**
152   * Number of likes on the comment
153   */
154  @java.lang.SuppressWarnings("all")
155  public void setLikeCount(final Long likeCount) {
156    this.likeCount = likeCount;
157  }
158
159  /**
160   * Media on which the comment is made
161   */
162  @java.lang.SuppressWarnings("all")
163  public IgMedia getMedia() {
164    return this.media;
165  }
166
167  /**
168   * Media on which the comment is made
169   */
170  @java.lang.SuppressWarnings("all")
171  public void setMedia(final IgMedia media) {
172    this.media = media;
173  }
174
175  /**
176   * Text of the comment
177   */
178  @java.lang.SuppressWarnings("all")
179  public String getText() {
180    return this.text;
181  }
182
183  /**
184   * Text of the comment
185   */
186  @java.lang.SuppressWarnings("all")
187  public void setText(final String text) {
188    this.text = text;
189  }
190
191  /**
192   * Timestamp of comment
193   */
194  @java.lang.SuppressWarnings("all")
195  public Date getTimestamp() {
196    return this.timestamp;
197  }
198
199  /**
200   * Timestamp of comment
201   */
202  @java.lang.SuppressWarnings("all")
203  public void setTimestamp(final Date timestamp) {
204    this.timestamp = timestamp;
205  }
206
207  /**
208   * User who made the comment
209   *
210   * @deprecated with Graph API 12 or December 13, 2021 for all versions
211   */
212  @java.lang.Deprecated
213  @java.lang.SuppressWarnings("all")
214  public IgUser getUser() {
215    return this.user;
216  }
217
218  /**
219   * User who made the comment
220   *
221   * @deprecated with Graph API 12 or December 13, 2021 for all versions
222   */
223  @java.lang.Deprecated
224  @java.lang.SuppressWarnings("all")
225  public void setUser(final IgUser user) {
226    this.user = user;
227  }
228
229  /**
230   * User will only be returned when queried by owner of comment. Otherwise, username is the only field that will be
231   * returned.
232   */
233  @java.lang.SuppressWarnings("all")
234  public String getUsername() {
235    return this.username;
236  }
237
238  /**
239   * User will only be returned when queried by owner of comment. Otherwise, username is the only field that will be
240   * returned.
241   */
242  @java.lang.SuppressWarnings("all")
243  public void setUsername(final String username) {
244    this.username = username;
245  }
246
247  /**
248   * ID of the parent IG Comment if this comment was created on another IG Comment (i.e. a reply to another comment.
249   */
250  @java.lang.SuppressWarnings("all")
251  public String getParentId() {
252    return this.parentId;
253  }
254
255  /**
256   * ID of the parent IG Comment if this comment was created on another IG Comment (i.e. a reply to another comment.
257   */
258  @java.lang.SuppressWarnings("all")
259  public void setParentId(final String parentId) {
260    this.parentId = parentId;
261  }
262}