001// Generated by delombok at Wed Jan 31 21:27:42 UTC 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.List;
028import com.restfb.Facebook;
029import com.restfb.types.Insight;
030
031/**
032 * Represents the <a href="https://developers.facebook.com/docs/instagram-api/reference/media">instagram media</a> type
033 */
034public class IgMedia extends IgMediaChild {
035  private static final long serialVersionUID = 1L;
036  @Facebook
037  private String caption;
038  /**
039   * Count of comments on the media.
040   *
041   * Excludes comments on album child media and the media's caption. Includes replies on comments.
042   */
043  @Facebook("comments_count")
044  private Long commentsCount;
045  /**
046   * Indicates if comments are enabled or disabled. Excludes album children.
047   */
048  @Facebook("is_comment_enabled")
049  private Boolean isCommentEnabled;
050  /**
051   * Reels only. If {@code true}, indicates the reel can appear in both the Feed and Reels tabs.
052   * 
053   * If {@code false}, indicates the reel can only appear in the Reels tab.
054   */
055  @Facebook("is_shared_to_feed")
056  private Boolean isSharedToFeed;
057  /**
058   * Count of likes on the media.
059   *
060   * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on
061   * comments.
062   * 
063   * <ul>
064   * <li><strong>v10.0 and older calls</strong>: value will be 0 if the media owner has hidden like counts it.</li>
065   * <li><strong>v11.0+ calls</strong>: field will be omitted if media owner has hidden like counts on it.</li>
066   * </ul>
067   */
068  @Facebook("like_count")
069  private Long likeCount;
070  /**
071   * Media thumbnail URL. Only available on VIDEO media.
072   */
073  @Facebook("thumbnail_url")
074  private String thumbnailUrl;
075  /**
076   * IGTV media title.
077   * @deprecated Omitted from response.
078   */
079  @Deprecated
080  @Facebook("video_title")
081  private String videoTitle;
082  @Facebook("copyright_check_information")
083  private CopyrightCheckInformation copyrightCheckInformation;
084  @Facebook
085  private List<IgMediaChild> children = new ArrayList<>();
086  @Facebook
087  private List<Insight> insights = new ArrayList<>();
088  @Facebook
089  private List<IgComment> comments = new ArrayList<>();
090
091  /**
092   * returns the list of child media objects, only available if the media_type is a carousal
093   * 
094   * @return the list of children as unmodifiable list
095   */
096  public List<IgMediaChild> getChildren() {
097    return Collections.unmodifiableList(children);
098  }
099
100  /**
101   * adds a new child to the children list
102   * 
103   * @param child
104   *          the child that is added
105   * @return true if adding the child works
106   */
107  public boolean addChild(IgMediaChild child) {
108    return children.add(child);
109  }
110
111  /**
112   * removes a new child from the children list
113   * 
114   * @param child
115   *          the child that is removed
116   * @return true if removing the child works
117   */
118  public boolean removeChild(IgMediaChild child) {
119    return children.remove(child);
120  }
121
122  public List<Insight> getInsights() {
123    return Collections.unmodifiableList(insights);
124  }
125
126  public boolean addChild(Insight insight) {
127    return insights.add(insight);
128  }
129
130  public boolean removeChild(Insight insight) {
131    return insights.remove(insight);
132  }
133
134  /**
135   * returns the comments of this media
136   * 
137   * @return the comments of this media
138   */
139  public List<IgComment> getComments() {
140    return Collections.unmodifiableList(comments);
141  }
142
143  public boolean addComment(IgComment comment) {
144    return comments.add(comment);
145  }
146
147  public boolean removeComment(IgComment comment) {
148    return comments.remove(comment);
149  }
150
151  @java.lang.SuppressWarnings("all")
152  public String getCaption() {
153    return this.caption;
154  }
155
156  @java.lang.SuppressWarnings("all")
157  public void setCaption(final String caption) {
158    this.caption = caption;
159  }
160
161  /**
162   * Count of comments on the media.
163   *
164   * Excludes comments on album child media and the media's caption. Includes replies on comments.
165   */
166  @java.lang.SuppressWarnings("all")
167  public Long getCommentsCount() {
168    return this.commentsCount;
169  }
170
171  /**
172   * Count of comments on the media.
173   *
174   * Excludes comments on album child media and the media's caption. Includes replies on comments.
175   */
176  @java.lang.SuppressWarnings("all")
177  public void setCommentsCount(final Long commentsCount) {
178    this.commentsCount = commentsCount;
179  }
180
181  /**
182   * Indicates if comments are enabled or disabled. Excludes album children.
183   */
184  @java.lang.SuppressWarnings("all")
185  public Boolean getIsCommentEnabled() {
186    return this.isCommentEnabled;
187  }
188
189  /**
190   * Indicates if comments are enabled or disabled. Excludes album children.
191   */
192  @java.lang.SuppressWarnings("all")
193  public void setIsCommentEnabled(final Boolean isCommentEnabled) {
194    this.isCommentEnabled = isCommentEnabled;
195  }
196
197  /**
198   * Reels only. If {@code true}, indicates the reel can appear in both the Feed and Reels tabs.
199   * 
200   * If {@code false}, indicates the reel can only appear in the Reels tab.
201   */
202  @java.lang.SuppressWarnings("all")
203  public Boolean getIsSharedToFeed() {
204    return this.isSharedToFeed;
205  }
206
207  /**
208   * Reels only. If {@code true}, indicates the reel can appear in both the Feed and Reels tabs.
209   * 
210   * If {@code false}, indicates the reel can only appear in the Reels tab.
211   */
212  @java.lang.SuppressWarnings("all")
213  public void setIsSharedToFeed(final Boolean isSharedToFeed) {
214    this.isSharedToFeed = isSharedToFeed;
215  }
216
217  /**
218   * Count of likes on the media.
219   *
220   * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on
221   * comments.
222   * 
223   * <ul>
224   * <li><strong>v10.0 and older calls</strong>: value will be 0 if the media owner has hidden like counts it.</li>
225   * <li><strong>v11.0+ calls</strong>: field will be omitted if media owner has hidden like counts on it.</li>
226   * </ul>
227   */
228  @java.lang.SuppressWarnings("all")
229  public Long getLikeCount() {
230    return this.likeCount;
231  }
232
233  /**
234   * Count of likes on the media.
235   *
236   * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on
237   * comments.
238   * 
239   * <ul>
240   * <li><strong>v10.0 and older calls</strong>: value will be 0 if the media owner has hidden like counts it.</li>
241   * <li><strong>v11.0+ calls</strong>: field will be omitted if media owner has hidden like counts on it.</li>
242   * </ul>
243   */
244  @java.lang.SuppressWarnings("all")
245  public void setLikeCount(final Long likeCount) {
246    this.likeCount = likeCount;
247  }
248
249  /**
250   * Media thumbnail URL. Only available on VIDEO media.
251   */
252  @java.lang.SuppressWarnings("all")
253  public String getThumbnailUrl() {
254    return this.thumbnailUrl;
255  }
256
257  /**
258   * Media thumbnail URL. Only available on VIDEO media.
259   */
260  @java.lang.SuppressWarnings("all")
261  public void setThumbnailUrl(final String thumbnailUrl) {
262    this.thumbnailUrl = thumbnailUrl;
263  }
264
265  /**
266   * IGTV media title.
267   * @deprecated Omitted from response.
268   */
269  @java.lang.Deprecated
270  @java.lang.SuppressWarnings("all")
271  public String getVideoTitle() {
272    return this.videoTitle;
273  }
274
275  /**
276   * IGTV media title.
277   * @deprecated Omitted from response.
278   */
279  @java.lang.Deprecated
280  @java.lang.SuppressWarnings("all")
281  public void setVideoTitle(final String videoTitle) {
282    this.videoTitle = videoTitle;
283  }
284
285  @java.lang.SuppressWarnings("all")
286  public CopyrightCheckInformation getCopyrightCheckInformation() {
287    return this.copyrightCheckInformation;
288  }
289
290  @java.lang.SuppressWarnings("all")
291  public void setCopyrightCheckInformation(final CopyrightCheckInformation copyrightCheckInformation) {
292    this.copyrightCheckInformation = copyrightCheckInformation;
293  }
294}