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