001// Generated by delombok at Fri Jan 31 16:52:04 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.threads; 024 025import java.util.ArrayList; 026import java.util.Date; 027import java.util.List; 028import java.util.Locale; 029import com.restfb.Facebook; 030import com.restfb.types.FacebookType; 031 032/** 033 * Represents the <a href="https://developers.facebook.com/docs/threads/threads-media">Threads Media type</a> 034 */ 035public class TdMedia extends FacebookType { 036 private static final long serialVersionUID = -1L; 037 /** 038 * Surface where the media is published. In the case of Threads, the value is THREADS. 039 */ 040 @Facebook("media_product_type") 041 private String mediaProductType; 042 /** 043 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 044 * REPOST_FACADE. 045 */ 046 @Facebook("media_type") 047 private TdMediaType mediaType; 048 /** 049 * The post’s media URL. 050 */ 051 @Facebook("media_url") 052 private String mediaUrl; 053 /** 054 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 055 * copyright violation. 056 */ 057 @Facebook 058 private String permalink; 059 /** 060 * Instagram user ID who created the post. 061 */ 062 @Facebook 063 private TdProfile owner; 064 /** 065 * Instagram username who created the post. 066 */ 067 @Facebook 068 private String username; 069 /** 070 * Represents text for a Threads post. 071 */ 072 @Facebook 073 private String text; 074 /** 075 * Post time. The publish date in ISO 8601 format. 076 */ 077 @Facebook 078 private Date timestamp; 079 /** 080 * Shortcode of the media. 081 */ 082 @Facebook 083 private String shortcode; 084 /** 085 * URL of thumbnail. This only shows up for Threads media with video. 086 */ 087 @Facebook("thumbnail_url") 088 private String thumbnailUrl; 089 /** 090 * List of child posts. This only shows up for carousel posts. 091 */ 092 @Facebook 093 private List<TdMedia> children = new ArrayList<>(); 094 /** 095 * Indicates if the media is a quoted post made by another user 096 */ 097 @Facebook("is_quote_post") 098 private Boolean isQuotePost; 099 /** 100 * Media ID of the post that was quoted. Note: This only appears on quote posts. 101 */ 102 @Facebook("quoted_post") 103 private String quotedPost; 104 /** 105 * Media ID of the post that was reposted. Note: This only appears on reposts. 106 */ 107 @Facebook("reposted_post") 108 private String repostedPost; 109 /** 110 * The accessibility text label or description for an image or video in a Threads post 111 */ 112 @Facebook("alt_text") 113 private String altText; 114 @Facebook("allowlisted_country_codes") 115 private List<String> allowlistedCountryCodes = new ArrayList<>(); 116 /** 117 * link attachment URL of the URL that is attachment with highlight. 118 * See here: https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 119 */ 120 @Facebook("link_attachment_url") 121 private String linkAttachmentUrl; 122 123 public List<Locale> getAllowlistedCountryCodesAsLocales() { 124 List<Locale> locales = new ArrayList<>(); 125 for (String code : allowlistedCountryCodes) { 126 locales.add(new Locale("", code)); 127 } 128 return locales; 129 } 130 131 /** 132 * Surface where the media is published. In the case of Threads, the value is THREADS. 133 */ 134 @java.lang.SuppressWarnings("all") 135 public String getMediaProductType() { 136 return this.mediaProductType; 137 } 138 139 /** 140 * Surface where the media is published. In the case of Threads, the value is THREADS. 141 */ 142 @java.lang.SuppressWarnings("all") 143 public void setMediaProductType(final String mediaProductType) { 144 this.mediaProductType = mediaProductType; 145 } 146 147 /** 148 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 149 * REPOST_FACADE. 150 */ 151 @java.lang.SuppressWarnings("all") 152 public TdMediaType getMediaType() { 153 return this.mediaType; 154 } 155 156 /** 157 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 158 * REPOST_FACADE. 159 */ 160 @java.lang.SuppressWarnings("all") 161 public void setMediaType(final TdMediaType mediaType) { 162 this.mediaType = mediaType; 163 } 164 165 /** 166 * The post’s media URL. 167 */ 168 @java.lang.SuppressWarnings("all") 169 public String getMediaUrl() { 170 return this.mediaUrl; 171 } 172 173 /** 174 * The post’s media URL. 175 */ 176 @java.lang.SuppressWarnings("all") 177 public void setMediaUrl(final String mediaUrl) { 178 this.mediaUrl = mediaUrl; 179 } 180 181 /** 182 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 183 * copyright violation. 184 */ 185 @java.lang.SuppressWarnings("all") 186 public String getPermalink() { 187 return this.permalink; 188 } 189 190 /** 191 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 192 * copyright violation. 193 */ 194 @java.lang.SuppressWarnings("all") 195 public void setPermalink(final String permalink) { 196 this.permalink = permalink; 197 } 198 199 /** 200 * Instagram user ID who created the post. 201 */ 202 @java.lang.SuppressWarnings("all") 203 public TdProfile getOwner() { 204 return this.owner; 205 } 206 207 /** 208 * Instagram user ID who created the post. 209 */ 210 @java.lang.SuppressWarnings("all") 211 public void setOwner(final TdProfile owner) { 212 this.owner = owner; 213 } 214 215 /** 216 * Instagram username who created the post. 217 */ 218 @java.lang.SuppressWarnings("all") 219 public String getUsername() { 220 return this.username; 221 } 222 223 /** 224 * Instagram username who created the post. 225 */ 226 @java.lang.SuppressWarnings("all") 227 public void setUsername(final String username) { 228 this.username = username; 229 } 230 231 /** 232 * Represents text for a Threads post. 233 */ 234 @java.lang.SuppressWarnings("all") 235 public String getText() { 236 return this.text; 237 } 238 239 /** 240 * Represents text for a Threads post. 241 */ 242 @java.lang.SuppressWarnings("all") 243 public void setText(final String text) { 244 this.text = text; 245 } 246 247 /** 248 * Post time. The publish date in ISO 8601 format. 249 */ 250 @java.lang.SuppressWarnings("all") 251 public Date getTimestamp() { 252 return this.timestamp; 253 } 254 255 /** 256 * Post time. The publish date in ISO 8601 format. 257 */ 258 @java.lang.SuppressWarnings("all") 259 public void setTimestamp(final Date timestamp) { 260 this.timestamp = timestamp; 261 } 262 263 /** 264 * Shortcode of the media. 265 */ 266 @java.lang.SuppressWarnings("all") 267 public String getShortcode() { 268 return this.shortcode; 269 } 270 271 /** 272 * Shortcode of the media. 273 */ 274 @java.lang.SuppressWarnings("all") 275 public void setShortcode(final String shortcode) { 276 this.shortcode = shortcode; 277 } 278 279 /** 280 * URL of thumbnail. This only shows up for Threads media with video. 281 */ 282 @java.lang.SuppressWarnings("all") 283 public String getThumbnailUrl() { 284 return this.thumbnailUrl; 285 } 286 287 /** 288 * URL of thumbnail. This only shows up for Threads media with video. 289 */ 290 @java.lang.SuppressWarnings("all") 291 public void setThumbnailUrl(final String thumbnailUrl) { 292 this.thumbnailUrl = thumbnailUrl; 293 } 294 295 /** 296 * List of child posts. This only shows up for carousel posts. 297 */ 298 @java.lang.SuppressWarnings("all") 299 public List<TdMedia> getChildren() { 300 return this.children; 301 } 302 303 /** 304 * List of child posts. This only shows up for carousel posts. 305 */ 306 @java.lang.SuppressWarnings("all") 307 public void setChildren(final List<TdMedia> children) { 308 this.children = children; 309 } 310 311 /** 312 * Indicates if the media is a quoted post made by another user 313 */ 314 @java.lang.SuppressWarnings("all") 315 public Boolean getIsQuotePost() { 316 return this.isQuotePost; 317 } 318 319 /** 320 * Indicates if the media is a quoted post made by another user 321 */ 322 @java.lang.SuppressWarnings("all") 323 public void setIsQuotePost(final Boolean isQuotePost) { 324 this.isQuotePost = isQuotePost; 325 } 326 327 /** 328 * Media ID of the post that was quoted. Note: This only appears on quote posts. 329 */ 330 @java.lang.SuppressWarnings("all") 331 public String getQuotedPost() { 332 return this.quotedPost; 333 } 334 335 /** 336 * Media ID of the post that was quoted. Note: This only appears on quote posts. 337 */ 338 @java.lang.SuppressWarnings("all") 339 public void setQuotedPost(final String quotedPost) { 340 this.quotedPost = quotedPost; 341 } 342 343 /** 344 * Media ID of the post that was reposted. Note: This only appears on reposts. 345 */ 346 @java.lang.SuppressWarnings("all") 347 public String getRepostedPost() { 348 return this.repostedPost; 349 } 350 351 /** 352 * Media ID of the post that was reposted. Note: This only appears on reposts. 353 */ 354 @java.lang.SuppressWarnings("all") 355 public void setRepostedPost(final String repostedPost) { 356 this.repostedPost = repostedPost; 357 } 358 359 /** 360 * The accessibility text label or description for an image or video in a Threads post 361 */ 362 @java.lang.SuppressWarnings("all") 363 public String getAltText() { 364 return this.altText; 365 } 366 367 /** 368 * The accessibility text label or description for an image or video in a Threads post 369 */ 370 @java.lang.SuppressWarnings("all") 371 public void setAltText(final String altText) { 372 this.altText = altText; 373 } 374 375 @java.lang.SuppressWarnings("all") 376 public List<String> getAllowlistedCountryCodes() { 377 return this.allowlistedCountryCodes; 378 } 379 380 @java.lang.SuppressWarnings("all") 381 public void setAllowlistedCountryCodes(final List<String> allowlistedCountryCodes) { 382 this.allowlistedCountryCodes = allowlistedCountryCodes; 383 } 384 385 /** 386 * link attachment URL of the URL that is attachment with highlight. 387 * See here: https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 388 */ 389 @java.lang.SuppressWarnings("all") 390 public String getLinkAttachmentUrl() { 391 return this.linkAttachmentUrl; 392 } 393 394 /** 395 * link attachment URL of the URL that is attachment with highlight. 396 * See here: https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 397 */ 398 @java.lang.SuppressWarnings("all") 399 public void setLinkAttachmentUrl(final String linkAttachmentUrl) { 400 this.linkAttachmentUrl = linkAttachmentUrl; 401 } 402}