001// Generated by delombok at Thu Aug 13 13:56:44 UTC 2026 002/* 003 * Copyright (c) 2010-2026 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 /** 115 * The ID of the location tagged to the media. 116 */ 117 @Facebook("location_id") 118 private String locationId; 119 /** 120 * The location tagged to the media. 121 */ 122 @Facebook 123 private TdLocation location; 124 @Facebook("allowlisted_country_codes") 125 private List<String> allowlistedCountryCodes = new ArrayList<>(); 126 /** 127 * link attachment URL of the URL that is attachment with highlight. See here: 128 * https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 129 */ 130 @Facebook("link_attachment_url") 131 private String linkAttachmentUrl; 132 @Facebook("poll_attachment") 133 private TdPollAttachment pollAttachment; 134 @Facebook("text_attachment") 135 private TdTextAttachment textAttachment; 136 137 public List<Locale> getAllowlistedCountryCodesAsLocales() { 138 List<Locale> locales = new ArrayList<>(); 139 for (String code : allowlistedCountryCodes) { 140 locales.add(new Locale("", code)); 141 } 142 return locales; 143 } 144 145 /** 146 * Surface where the media is published. In the case of Threads, the value is THREADS. 147 */ 148 @java.lang.SuppressWarnings("all") 149 @lombok.Generated 150 public String getMediaProductType() { 151 return this.mediaProductType; 152 } 153 154 /** 155 * Surface where the media is published. In the case of Threads, the value is THREADS. 156 */ 157 @java.lang.SuppressWarnings("all") 158 @lombok.Generated 159 public void setMediaProductType(final String mediaProductType) { 160 this.mediaProductType = mediaProductType; 161 } 162 163 /** 164 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 165 * REPOST_FACADE. 166 */ 167 @java.lang.SuppressWarnings("all") 168 @lombok.Generated 169 public TdMediaType getMediaType() { 170 return this.mediaType; 171 } 172 173 /** 174 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 175 * REPOST_FACADE. 176 */ 177 @java.lang.SuppressWarnings("all") 178 @lombok.Generated 179 public void setMediaType(final TdMediaType mediaType) { 180 this.mediaType = mediaType; 181 } 182 183 /** 184 * The post’s media URL. 185 */ 186 @java.lang.SuppressWarnings("all") 187 @lombok.Generated 188 public String getMediaUrl() { 189 return this.mediaUrl; 190 } 191 192 /** 193 * The post’s media URL. 194 */ 195 @java.lang.SuppressWarnings("all") 196 @lombok.Generated 197 public void setMediaUrl(final String mediaUrl) { 198 this.mediaUrl = mediaUrl; 199 } 200 201 /** 202 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 203 * copyright violation. 204 */ 205 @java.lang.SuppressWarnings("all") 206 @lombok.Generated 207 public String getPermalink() { 208 return this.permalink; 209 } 210 211 /** 212 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 213 * copyright violation. 214 */ 215 @java.lang.SuppressWarnings("all") 216 @lombok.Generated 217 public void setPermalink(final String permalink) { 218 this.permalink = permalink; 219 } 220 221 /** 222 * Instagram user ID who created the post. 223 */ 224 @java.lang.SuppressWarnings("all") 225 @lombok.Generated 226 public TdProfile getOwner() { 227 return this.owner; 228 } 229 230 /** 231 * Instagram user ID who created the post. 232 */ 233 @java.lang.SuppressWarnings("all") 234 @lombok.Generated 235 public void setOwner(final TdProfile owner) { 236 this.owner = owner; 237 } 238 239 /** 240 * Instagram username who created the post. 241 */ 242 @java.lang.SuppressWarnings("all") 243 @lombok.Generated 244 public String getUsername() { 245 return this.username; 246 } 247 248 /** 249 * Instagram username who created the post. 250 */ 251 @java.lang.SuppressWarnings("all") 252 @lombok.Generated 253 public void setUsername(final String username) { 254 this.username = username; 255 } 256 257 /** 258 * Represents text for a Threads post. 259 */ 260 @java.lang.SuppressWarnings("all") 261 @lombok.Generated 262 public String getText() { 263 return this.text; 264 } 265 266 /** 267 * Represents text for a Threads post. 268 */ 269 @java.lang.SuppressWarnings("all") 270 @lombok.Generated 271 public void setText(final String text) { 272 this.text = text; 273 } 274 275 /** 276 * Post time. The publish date in ISO 8601 format. 277 */ 278 @java.lang.SuppressWarnings("all") 279 @lombok.Generated 280 public Date getTimestamp() { 281 return this.timestamp; 282 } 283 284 /** 285 * Post time. The publish date in ISO 8601 format. 286 */ 287 @java.lang.SuppressWarnings("all") 288 @lombok.Generated 289 public void setTimestamp(final Date timestamp) { 290 this.timestamp = timestamp; 291 } 292 293 /** 294 * Shortcode of the media. 295 */ 296 @java.lang.SuppressWarnings("all") 297 @lombok.Generated 298 public String getShortcode() { 299 return this.shortcode; 300 } 301 302 /** 303 * Shortcode of the media. 304 */ 305 @java.lang.SuppressWarnings("all") 306 @lombok.Generated 307 public void setShortcode(final String shortcode) { 308 this.shortcode = shortcode; 309 } 310 311 /** 312 * URL of thumbnail. This only shows up for Threads media with video. 313 */ 314 @java.lang.SuppressWarnings("all") 315 @lombok.Generated 316 public String getThumbnailUrl() { 317 return this.thumbnailUrl; 318 } 319 320 /** 321 * URL of thumbnail. This only shows up for Threads media with video. 322 */ 323 @java.lang.SuppressWarnings("all") 324 @lombok.Generated 325 public void setThumbnailUrl(final String thumbnailUrl) { 326 this.thumbnailUrl = thumbnailUrl; 327 } 328 329 /** 330 * List of child posts. This only shows up for carousel posts. 331 */ 332 @java.lang.SuppressWarnings("all") 333 @lombok.Generated 334 public List<TdMedia> getChildren() { 335 return this.children; 336 } 337 338 /** 339 * List of child posts. This only shows up for carousel posts. 340 */ 341 @java.lang.SuppressWarnings("all") 342 @lombok.Generated 343 public void setChildren(final List<TdMedia> children) { 344 this.children = children; 345 } 346 347 /** 348 * Indicates if the media is a quoted post made by another user 349 */ 350 @java.lang.SuppressWarnings("all") 351 @lombok.Generated 352 public Boolean getIsQuotePost() { 353 return this.isQuotePost; 354 } 355 356 /** 357 * Indicates if the media is a quoted post made by another user 358 */ 359 @java.lang.SuppressWarnings("all") 360 @lombok.Generated 361 public void setIsQuotePost(final Boolean isQuotePost) { 362 this.isQuotePost = isQuotePost; 363 } 364 365 /** 366 * Media ID of the post that was quoted. Note: This only appears on quote posts. 367 */ 368 @java.lang.SuppressWarnings("all") 369 @lombok.Generated 370 public String getQuotedPost() { 371 return this.quotedPost; 372 } 373 374 /** 375 * Media ID of the post that was quoted. Note: This only appears on quote posts. 376 */ 377 @java.lang.SuppressWarnings("all") 378 @lombok.Generated 379 public void setQuotedPost(final String quotedPost) { 380 this.quotedPost = quotedPost; 381 } 382 383 /** 384 * Media ID of the post that was reposted. Note: This only appears on reposts. 385 */ 386 @java.lang.SuppressWarnings("all") 387 @lombok.Generated 388 public String getRepostedPost() { 389 return this.repostedPost; 390 } 391 392 /** 393 * Media ID of the post that was reposted. Note: This only appears on reposts. 394 */ 395 @java.lang.SuppressWarnings("all") 396 @lombok.Generated 397 public void setRepostedPost(final String repostedPost) { 398 this.repostedPost = repostedPost; 399 } 400 401 /** 402 * The accessibility text label or description for an image or video in a Threads post 403 */ 404 @java.lang.SuppressWarnings("all") 405 @lombok.Generated 406 public String getAltText() { 407 return this.altText; 408 } 409 410 /** 411 * The accessibility text label or description for an image or video in a Threads post 412 */ 413 @java.lang.SuppressWarnings("all") 414 @lombok.Generated 415 public void setAltText(final String altText) { 416 this.altText = altText; 417 } 418 419 /** 420 * The ID of the location tagged to the media. 421 */ 422 @java.lang.SuppressWarnings("all") 423 @lombok.Generated 424 public String getLocationId() { 425 return this.locationId; 426 } 427 428 /** 429 * The ID of the location tagged to the media. 430 */ 431 @java.lang.SuppressWarnings("all") 432 @lombok.Generated 433 public void setLocationId(final String locationId) { 434 this.locationId = locationId; 435 } 436 437 /** 438 * The location tagged to the media. 439 */ 440 @java.lang.SuppressWarnings("all") 441 @lombok.Generated 442 public TdLocation getLocation() { 443 return this.location; 444 } 445 446 /** 447 * The location tagged to the media. 448 */ 449 @java.lang.SuppressWarnings("all") 450 @lombok.Generated 451 public void setLocation(final TdLocation location) { 452 this.location = location; 453 } 454 455 @java.lang.SuppressWarnings("all") 456 @lombok.Generated 457 public List<String> getAllowlistedCountryCodes() { 458 return this.allowlistedCountryCodes; 459 } 460 461 @java.lang.SuppressWarnings("all") 462 @lombok.Generated 463 public void setAllowlistedCountryCodes(final List<String> allowlistedCountryCodes) { 464 this.allowlistedCountryCodes = allowlistedCountryCodes; 465 } 466 467 /** 468 * link attachment URL of the URL that is attachment with highlight. See here: 469 * https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 470 */ 471 @java.lang.SuppressWarnings("all") 472 @lombok.Generated 473 public String getLinkAttachmentUrl() { 474 return this.linkAttachmentUrl; 475 } 476 477 /** 478 * link attachment URL of the URL that is attachment with highlight. See here: 479 * https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 480 */ 481 @java.lang.SuppressWarnings("all") 482 @lombok.Generated 483 public void setLinkAttachmentUrl(final String linkAttachmentUrl) { 484 this.linkAttachmentUrl = linkAttachmentUrl; 485 } 486 487 @java.lang.SuppressWarnings("all") 488 @lombok.Generated 489 public TdPollAttachment getPollAttachment() { 490 return this.pollAttachment; 491 } 492 493 @java.lang.SuppressWarnings("all") 494 @lombok.Generated 495 public void setPollAttachment(final TdPollAttachment pollAttachment) { 496 this.pollAttachment = pollAttachment; 497 } 498 499 @java.lang.SuppressWarnings("all") 500 @lombok.Generated 501 public TdTextAttachment getTextAttachment() { 502 return this.textAttachment; 503 } 504 505 @java.lang.SuppressWarnings("all") 506 @lombok.Generated 507 public void setTextAttachment(final TdTextAttachment textAttachment) { 508 this.textAttachment = textAttachment; 509 } 510}