001// Generated by delombok at Sun Sep 26 16:30:34 CEST 2021
002/*
003 * Copyright (c) 2010-2021 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   * Count of likes on the media.
052   *
053   * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on comments.
054   */
055  @Facebook("like_count")
056  private Long likeCount;
057  /**
058   * Surface where the media is published. Can be AD, FEED, IGTV, or STORY.
059   */
060  @Facebook("media_product_type")
061  private String mediaProductType;
062  /**
063   * Media thumbnail URL. Only available on VIDEO media.
064   */
065  @Facebook("thumbnail_url")
066  private String thumbnailUrl;
067  /**
068   * IGTV media title.
069   */
070  @Facebook("video_title")
071  private String videoTitle;
072  @Facebook
073  private List<IgMediaChild> children = new ArrayList<>();
074  @Facebook
075  private List<Insight> insights = new ArrayList<>();
076  @Facebook
077  private List<IgComment> comments = new ArrayList<>();
078
079  /**
080   * returns the list of child media objects, only available if the media_type is a carousal
081   * 
082   * @return the list of children as unmodifiable list
083   */
084  public List<IgMediaChild> getChildren() {
085    return Collections.unmodifiableList(children);
086  }
087
088  /**
089   * adds a new child to the children list
090   * 
091   * @param child
092   *          the child that is added
093   * @return true if adding the child works
094   */
095  public boolean addChild(IgMediaChild child) {
096    return children.add(child);
097  }
098
099  /**
100   * removes a new child from the children list
101   * 
102   * @param child
103   *          the child that is removed
104   * @return true if removing the child works
105   */
106  public boolean removeChild(IgMediaChild child) {
107    return children.remove(child);
108  }
109
110  public List<Insight> getInsights() {
111    return Collections.unmodifiableList(insights);
112  }
113
114  public boolean addChild(Insight insight) {
115    return insights.add(insight);
116  }
117
118  public boolean removeChild(Insight insight) {
119    return insights.remove(insight);
120  }
121
122  /**
123   * returns the comments of this media
124   * 
125   * @return the comments of this media
126   */
127  public List<IgComment> getComments() {
128    return Collections.unmodifiableList(comments);
129  }
130
131  public boolean addComment(IgComment comment) {
132    return comments.add(comment);
133  }
134
135  public boolean removeComment(IgComment comment) {
136    return comments.remove(comment);
137  }
138
139  @java.lang.SuppressWarnings("all")
140  public String getCaption() {
141    return this.caption;
142  }
143
144  @java.lang.SuppressWarnings("all")
145  public void setCaption(final String caption) {
146    this.caption = caption;
147  }
148
149  /**
150   * Count of comments on the media.
151   *
152   * Excludes comments on album child media and the media's caption. Includes replies on comments.
153   */
154  @java.lang.SuppressWarnings("all")
155  public Long getCommentsCount() {
156    return this.commentsCount;
157  }
158
159  /**
160   * Count of comments on the media.
161   *
162   * Excludes comments on album child media and the media's caption. Includes replies on comments.
163   */
164  @java.lang.SuppressWarnings("all")
165  public void setCommentsCount(final Long commentsCount) {
166    this.commentsCount = commentsCount;
167  }
168
169  /**
170   * Indicates if comments are enabled or disabled. Excludes album children.
171   */
172  @java.lang.SuppressWarnings("all")
173  public Boolean getIsCommentEnabled() {
174    return this.isCommentEnabled;
175  }
176
177  /**
178   * Indicates if comments are enabled or disabled. Excludes album children.
179   */
180  @java.lang.SuppressWarnings("all")
181  public void setIsCommentEnabled(final Boolean isCommentEnabled) {
182    this.isCommentEnabled = isCommentEnabled;
183  }
184
185  /**
186   * Count of likes on the media.
187   *
188   * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on comments.
189   */
190  @java.lang.SuppressWarnings("all")
191  public Long getLikeCount() {
192    return this.likeCount;
193  }
194
195  /**
196   * Count of likes on the media.
197   *
198   * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on comments.
199   */
200  @java.lang.SuppressWarnings("all")
201  public void setLikeCount(final Long likeCount) {
202    this.likeCount = likeCount;
203  }
204
205  /**
206   * Surface where the media is published. Can be AD, FEED, IGTV, or STORY.
207   */
208  @java.lang.SuppressWarnings("all")
209  public String getMediaProductType() {
210    return this.mediaProductType;
211  }
212
213  /**
214   * Surface where the media is published. Can be AD, FEED, IGTV, or STORY.
215   */
216  @java.lang.SuppressWarnings("all")
217  public void setMediaProductType(final String mediaProductType) {
218    this.mediaProductType = mediaProductType;
219  }
220
221  /**
222   * Media thumbnail URL. Only available on VIDEO media.
223   */
224  @java.lang.SuppressWarnings("all")
225  public String getThumbnailUrl() {
226    return this.thumbnailUrl;
227  }
228
229  /**
230   * Media thumbnail URL. Only available on VIDEO media.
231   */
232  @java.lang.SuppressWarnings("all")
233  public void setThumbnailUrl(final String thumbnailUrl) {
234    this.thumbnailUrl = thumbnailUrl;
235  }
236
237  /**
238   * IGTV media title.
239   */
240  @java.lang.SuppressWarnings("all")
241  public String getVideoTitle() {
242    return this.videoTitle;
243  }
244
245  /**
246   * IGTV media title.
247   */
248  @java.lang.SuppressWarnings("all")
249  public void setVideoTitle(final String videoTitle) {
250    this.videoTitle = videoTitle;
251  }
252}