001// Generated by delombok at Tue Jun 03 09:05:42 UTC 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.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 * The ID for Instagram media that was created for Marketing API endpoints for v21.0 and older. 091 */ 092 @Facebook("legacy_instagram_media_id") 093 private String legacyInstagramMediaId; 094 /** 095 * IGTV media title. 096 * 097 * @deprecated Omitted from response. 098 */ 099 @Deprecated 100 @Facebook("video_title") 101 private String videoTitle; 102 @Facebook("copyright_check_information") 103 private CopyrightCheckInformation copyrightCheckInformation; 104 @Facebook 105 private List<IgMediaChild> children = new ArrayList<>(); 106 @Facebook 107 private List<Insight> insights = new ArrayList<>(); 108 @Facebook 109 private List<IgComment> comments = new ArrayList<>(); 110 111 /** 112 * returns the list of child media objects, only available if the media_type is a carousal 113 * 114 * @return the list of children as unmodifiable list 115 */ 116 public List<IgMediaChild> getChildren() { 117 return Collections.unmodifiableList(children); 118 } 119 120 /** 121 * adds a new child to the children list 122 * 123 * @param child 124 * the child that is added 125 * @return true if adding the child works 126 */ 127 public boolean addChild(IgMediaChild child) { 128 return children.add(child); 129 } 130 131 /** 132 * removes a new child from the children list 133 * 134 * @param child 135 * the child that is removed 136 * @return true if removing the child works 137 */ 138 public boolean removeChild(IgMediaChild child) { 139 return children.remove(child); 140 } 141 142 public List<Insight> getInsights() { 143 return Collections.unmodifiableList(insights); 144 } 145 146 public boolean addChild(Insight insight) { 147 return insights.add(insight); 148 } 149 150 public boolean removeChild(Insight insight) { 151 return insights.remove(insight); 152 } 153 154 /** 155 * returns the comments of this media 156 * 157 * @return the comments of this media 158 */ 159 public List<IgComment> getComments() { 160 return Collections.unmodifiableList(comments); 161 } 162 163 public boolean addComment(IgComment comment) { 164 return comments.add(comment); 165 } 166 167 public boolean removeComment(IgComment comment) { 168 return comments.remove(comment); 169 } 170 171 /** 172 * The field provides information about boosting eligibility of a IG instagram media as an ad and additional details 173 * if not eligible. 174 */ 175 @java.lang.SuppressWarnings("all") 176 public IgBoostEligibilityInfo getBoostEligibilityInfo() { 177 return this.boostEligibilityInfo; 178 } 179 180 /** 181 * The field provides information about boosting eligibility of a IG instagram media as an ad and additional details 182 * if not eligible. 183 */ 184 @java.lang.SuppressWarnings("all") 185 public void setBoostEligibilityInfo(final IgBoostEligibilityInfo boostEligibilityInfo) { 186 this.boostEligibilityInfo = boostEligibilityInfo; 187 } 188 189 @java.lang.SuppressWarnings("all") 190 public List<IgBoostMediaAd> getBoostAdsList() { 191 return this.boostAdsList; 192 } 193 194 @java.lang.SuppressWarnings("all") 195 public void setBoostAdsList(final List<IgBoostMediaAd> boostAdsList) { 196 this.boostAdsList = boostAdsList; 197 } 198 199 /** 200 * Caption. Excludes album children. The @ symbol is excluded, unless the app user can perform admin-equivalent tasks 201 * on the Facebook Page connected to the Instagram account used to create the caption. 202 */ 203 @java.lang.SuppressWarnings("all") 204 public String getCaption() { 205 return this.caption; 206 } 207 208 /** 209 * Caption. Excludes album children. The @ symbol is excluded, unless the app user can perform admin-equivalent tasks 210 * on the Facebook Page connected to the Instagram account used to create the caption. 211 */ 212 @java.lang.SuppressWarnings("all") 213 public void setCaption(final String caption) { 214 this.caption = caption; 215 } 216 217 /** 218 * Count of comments on the media. 219 * <p> 220 * Excludes comments on album child media and the media's caption. Includes replies on comments. 221 */ 222 @java.lang.SuppressWarnings("all") 223 public Long getCommentsCount() { 224 return this.commentsCount; 225 } 226 227 /** 228 * Count of comments on the media. 229 * <p> 230 * Excludes comments on album child media and the media's caption. Includes replies on comments. 231 */ 232 @java.lang.SuppressWarnings("all") 233 public void setCommentsCount(final Long commentsCount) { 234 this.commentsCount = commentsCount; 235 } 236 237 /** 238 * Indicates if comments are enabled or disabled. Excludes album children. 239 */ 240 @java.lang.SuppressWarnings("all") 241 public Boolean getIsCommentEnabled() { 242 return this.isCommentEnabled; 243 } 244 245 /** 246 * Indicates if comments are enabled or disabled. Excludes album children. 247 */ 248 @java.lang.SuppressWarnings("all") 249 public void setIsCommentEnabled(final Boolean isCommentEnabled) { 250 this.isCommentEnabled = isCommentEnabled; 251 } 252 253 /** 254 * Reels only. If {@code true}, indicates the reel can appear in both the Feed and Reels tabs. 255 * <p> 256 * If {@code false}, indicates the reel can only appear in the Reels tab. 257 */ 258 @java.lang.SuppressWarnings("all") 259 public Boolean getIsSharedToFeed() { 260 return this.isSharedToFeed; 261 } 262 263 /** 264 * Reels only. If {@code true}, indicates the reel can appear in both the Feed and Reels tabs. 265 * <p> 266 * If {@code false}, indicates the reel can only appear in the Reels tab. 267 */ 268 @java.lang.SuppressWarnings("all") 269 public void setIsSharedToFeed(final Boolean isSharedToFeed) { 270 this.isSharedToFeed = isSharedToFeed; 271 } 272 273 /** 274 * Count of likes on the media. 275 * <p> 276 * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on 277 * comments. 278 * 279 * <ul> 280 * <li><strong>v10.0 and older calls</strong>: value will be 0 if the media owner has hidden like counts it.</li> 281 * <li><strong>v11.0+ calls</strong>: field will be omitted if media owner has hidden like counts on it.</li> 282 * </ul> 283 */ 284 @java.lang.SuppressWarnings("all") 285 public Long getLikeCount() { 286 return this.likeCount; 287 } 288 289 /** 290 * Count of likes on the media. 291 * <p> 292 * Excludes likes on album child media and likes on promoted posts created from the media. Includes replies on 293 * comments. 294 * 295 * <ul> 296 * <li><strong>v10.0 and older calls</strong>: value will be 0 if the media owner has hidden like counts it.</li> 297 * <li><strong>v11.0+ calls</strong>: field will be omitted if media owner has hidden like counts on it.</li> 298 * </ul> 299 */ 300 @java.lang.SuppressWarnings("all") 301 public void setLikeCount(final Long likeCount) { 302 this.likeCount = likeCount; 303 } 304 305 /** 306 * Media thumbnail URL. Only available on VIDEO media. 307 */ 308 @java.lang.SuppressWarnings("all") 309 public String getThumbnailUrl() { 310 return this.thumbnailUrl; 311 } 312 313 /** 314 * Media thumbnail URL. Only available on VIDEO media. 315 */ 316 @java.lang.SuppressWarnings("all") 317 public void setThumbnailUrl(final String thumbnailUrl) { 318 this.thumbnailUrl = thumbnailUrl; 319 } 320 321 /** 322 * The ID for Instagram media that was created for Marketing API endpoints for v21.0 and older. 323 */ 324 @java.lang.SuppressWarnings("all") 325 public String getLegacyInstagramMediaId() { 326 return this.legacyInstagramMediaId; 327 } 328 329 /** 330 * The ID for Instagram media that was created for Marketing API endpoints for v21.0 and older. 331 */ 332 @java.lang.SuppressWarnings("all") 333 public void setLegacyInstagramMediaId(final String legacyInstagramMediaId) { 334 this.legacyInstagramMediaId = legacyInstagramMediaId; 335 } 336 337 /** 338 * IGTV media title. 339 * 340 * @deprecated Omitted from response. 341 */ 342 @java.lang.Deprecated 343 @java.lang.SuppressWarnings("all") 344 public String getVideoTitle() { 345 return this.videoTitle; 346 } 347 348 /** 349 * IGTV media title. 350 * 351 * @deprecated Omitted from response. 352 */ 353 @java.lang.Deprecated 354 @java.lang.SuppressWarnings("all") 355 public void setVideoTitle(final String videoTitle) { 356 this.videoTitle = videoTitle; 357 } 358 359 @java.lang.SuppressWarnings("all") 360 public CopyrightCheckInformation getCopyrightCheckInformation() { 361 return this.copyrightCheckInformation; 362 } 363 364 @java.lang.SuppressWarnings("all") 365 public void setCopyrightCheckInformation(final CopyrightCheckInformation copyrightCheckInformation) { 366 this.copyrightCheckInformation = copyrightCheckInformation; 367 } 368}