001// Generated by delombok at Wed Feb 12 09:04:33 CET 2025
002/*
003 * Copyright (c) 2010-2025 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-platform/instagram-graph-api/reference/ig-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  /**
091   * The ID for Instagram comment that was created for Marketing API endpoints for v21.0 and older.
092   */
093  @Facebook("legacy_instagram_comment_id")
094  private String legacyInstagramCommentId;
095  @Facebook
096  private List<IgComment> replies = new ArrayList<>();
097
098  /**
099   * Get a list of IG Comments on the IG Comment; Create an IG Comment on an IG Comment.
100   */
101  public List<IgComment> getReplies() {
102    return Collections.unmodifiableList(replies);
103  }
104
105  public boolean addReply(IgComment reply) {
106    return replies.add(reply);
107  }
108
109  public boolean removeReply(IgComment reply) {
110    return replies.remove(reply);
111  }
112
113  /**
114   * Whether the comment is hidden
115   */
116  @java.lang.SuppressWarnings("all")
117  public Boolean getHidden() {
118    return this.hidden;
119  }
120
121  /**
122   * Whether the comment is hidden
123   */
124  @java.lang.SuppressWarnings("all")
125  public void setHidden(final Boolean hidden) {
126    this.hidden = hidden;
127  }
128
129  /**
130   * An object containing:
131   *
132   * id — IGSID of the Instagram user who created the IG Comment.
133   * username — Username of the Instagram user who created the IG Comment.
134   */
135  @java.lang.SuppressWarnings("all")
136  public IgFrom getFrom() {
137    return this.from;
138  }
139
140  /**
141   * An object containing:
142   *
143   * id — IGSID of the Instagram user who created the IG Comment.
144   * username — Username of the Instagram user who created the IG Comment.
145   */
146  @java.lang.SuppressWarnings("all")
147  public void setFrom(final IgFrom from) {
148    this.from = from;
149  }
150
151  /**
152   * Number of likes on the comment
153   */
154  @java.lang.SuppressWarnings("all")
155  public Long getLikeCount() {
156    return this.likeCount;
157  }
158
159  /**
160   * Number of likes on the comment
161   */
162  @java.lang.SuppressWarnings("all")
163  public void setLikeCount(final Long likeCount) {
164    this.likeCount = likeCount;
165  }
166
167  /**
168   * Media on which the comment is made
169   */
170  @java.lang.SuppressWarnings("all")
171  public IgMedia getMedia() {
172    return this.media;
173  }
174
175  /**
176   * Media on which the comment is made
177   */
178  @java.lang.SuppressWarnings("all")
179  public void setMedia(final IgMedia media) {
180    this.media = media;
181  }
182
183  /**
184   * Text of the comment
185   */
186  @java.lang.SuppressWarnings("all")
187  public String getText() {
188    return this.text;
189  }
190
191  /**
192   * Text of the comment
193   */
194  @java.lang.SuppressWarnings("all")
195  public void setText(final String text) {
196    this.text = text;
197  }
198
199  /**
200   * Timestamp of comment
201   */
202  @java.lang.SuppressWarnings("all")
203  public Date getTimestamp() {
204    return this.timestamp;
205  }
206
207  /**
208   * Timestamp of comment
209   */
210  @java.lang.SuppressWarnings("all")
211  public void setTimestamp(final Date timestamp) {
212    this.timestamp = timestamp;
213  }
214
215  /**
216   * User who made the comment
217   *
218   * @deprecated with Graph API 12 or December 13, 2021 for all versions
219   */
220  @java.lang.Deprecated
221  @java.lang.SuppressWarnings("all")
222  public IgUser getUser() {
223    return this.user;
224  }
225
226  /**
227   * User who made the comment
228   *
229   * @deprecated with Graph API 12 or December 13, 2021 for all versions
230   */
231  @java.lang.Deprecated
232  @java.lang.SuppressWarnings("all")
233  public void setUser(final IgUser user) {
234    this.user = user;
235  }
236
237  /**
238   * User will only be returned when queried by owner of comment. Otherwise, username is the only field that will be
239   * returned.
240   */
241  @java.lang.SuppressWarnings("all")
242  public String getUsername() {
243    return this.username;
244  }
245
246  /**
247   * User will only be returned when queried by owner of comment. Otherwise, username is the only field that will be
248   * returned.
249   */
250  @java.lang.SuppressWarnings("all")
251  public void setUsername(final String username) {
252    this.username = username;
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 String getParentId() {
260    return this.parentId;
261  }
262
263  /**
264   * ID of the parent IG Comment if this comment was created on another IG Comment (i.e. a reply to another comment.
265   */
266  @java.lang.SuppressWarnings("all")
267  public void setParentId(final String parentId) {
268    this.parentId = parentId;
269  }
270
271  /**
272   * The ID for Instagram comment that was created for Marketing API endpoints for v21.0 and older.
273   */
274  @java.lang.SuppressWarnings("all")
275  public String getLegacyInstagramCommentId() {
276    return this.legacyInstagramCommentId;
277  }
278
279  /**
280   * The ID for Instagram comment that was created for Marketing API endpoints for v21.0 and older.
281   */
282  @java.lang.SuppressWarnings("all")
283  public void setLegacyInstagramCommentId(final String legacyInstagramCommentId) {
284    this.legacyInstagramCommentId = legacyInstagramCommentId;
285  }
286}