001// Generated by delombok at Fri Oct 04 16:05:59 CEST 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.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 * The accessibility text label or description for an image or video in a Threads post 101 */ 102 @Facebook("alt_text") 103 private String altText; 104 @Facebook("allowlisted_country_codes") 105 private List<String> allowlistedCountryCodes = new ArrayList<>(); 106 /** 107 * link attachment URL of the URL that is attachment with highlight. 108 * See here: https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 109 */ 110 @Facebook("link_attachment_url") 111 private String linkAttachmentUrl; 112 113 public List<Locale> getAllowlistedCountryCodesAsLocales() { 114 List<Locale> locales = new ArrayList<>(); 115 for (String code : allowlistedCountryCodes) { 116 locales.add(new Locale("", code)); 117 } 118 return locales; 119 } 120 121 /** 122 * Surface where the media is published. In the case of Threads, the value is THREADS. 123 */ 124 @java.lang.SuppressWarnings("all") 125 public String getMediaProductType() { 126 return this.mediaProductType; 127 } 128 129 /** 130 * Surface where the media is published. In the case of Threads, the value is THREADS. 131 */ 132 @java.lang.SuppressWarnings("all") 133 public void setMediaProductType(final String mediaProductType) { 134 this.mediaProductType = mediaProductType; 135 } 136 137 /** 138 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 139 * REPOST_FACADE. 140 */ 141 @java.lang.SuppressWarnings("all") 142 public TdMediaType getMediaType() { 143 return this.mediaType; 144 } 145 146 /** 147 * The media type for a Threads post will be one of these values: TEXT_POST, IMAGE, VIDEO, CAROUSEL_ALBUM, or 148 * REPOST_FACADE. 149 */ 150 @java.lang.SuppressWarnings("all") 151 public void setMediaType(final TdMediaType mediaType) { 152 this.mediaType = mediaType; 153 } 154 155 /** 156 * The post’s media URL. 157 */ 158 @java.lang.SuppressWarnings("all") 159 public String getMediaUrl() { 160 return this.mediaUrl; 161 } 162 163 /** 164 * The post’s media URL. 165 */ 166 @java.lang.SuppressWarnings("all") 167 public void setMediaUrl(final String mediaUrl) { 168 this.mediaUrl = mediaUrl; 169 } 170 171 /** 172 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 173 * copyright violation. 174 */ 175 @java.lang.SuppressWarnings("all") 176 public String getPermalink() { 177 return this.permalink; 178 } 179 180 /** 181 * Permanent link to the post. Will be omitted if the media contains copyrighted material or has been flagged for a 182 * copyright violation. 183 */ 184 @java.lang.SuppressWarnings("all") 185 public void setPermalink(final String permalink) { 186 this.permalink = permalink; 187 } 188 189 /** 190 * Instagram user ID who created the post. 191 */ 192 @java.lang.SuppressWarnings("all") 193 public TdProfile getOwner() { 194 return this.owner; 195 } 196 197 /** 198 * Instagram user ID who created the post. 199 */ 200 @java.lang.SuppressWarnings("all") 201 public void setOwner(final TdProfile owner) { 202 this.owner = owner; 203 } 204 205 /** 206 * Instagram username who created the post. 207 */ 208 @java.lang.SuppressWarnings("all") 209 public String getUsername() { 210 return this.username; 211 } 212 213 /** 214 * Instagram username who created the post. 215 */ 216 @java.lang.SuppressWarnings("all") 217 public void setUsername(final String username) { 218 this.username = username; 219 } 220 221 /** 222 * Represents text for a Threads post. 223 */ 224 @java.lang.SuppressWarnings("all") 225 public String getText() { 226 return this.text; 227 } 228 229 /** 230 * Represents text for a Threads post. 231 */ 232 @java.lang.SuppressWarnings("all") 233 public void setText(final String text) { 234 this.text = text; 235 } 236 237 /** 238 * Post time. The publish date in ISO 8601 format. 239 */ 240 @java.lang.SuppressWarnings("all") 241 public Date getTimestamp() { 242 return this.timestamp; 243 } 244 245 /** 246 * Post time. The publish date in ISO 8601 format. 247 */ 248 @java.lang.SuppressWarnings("all") 249 public void setTimestamp(final Date timestamp) { 250 this.timestamp = timestamp; 251 } 252 253 /** 254 * Shortcode of the media. 255 */ 256 @java.lang.SuppressWarnings("all") 257 public String getShortcode() { 258 return this.shortcode; 259 } 260 261 /** 262 * Shortcode of the media. 263 */ 264 @java.lang.SuppressWarnings("all") 265 public void setShortcode(final String shortcode) { 266 this.shortcode = shortcode; 267 } 268 269 /** 270 * URL of thumbnail. This only shows up for Threads media with video. 271 */ 272 @java.lang.SuppressWarnings("all") 273 public String getThumbnailUrl() { 274 return this.thumbnailUrl; 275 } 276 277 /** 278 * URL of thumbnail. This only shows up for Threads media with video. 279 */ 280 @java.lang.SuppressWarnings("all") 281 public void setThumbnailUrl(final String thumbnailUrl) { 282 this.thumbnailUrl = thumbnailUrl; 283 } 284 285 /** 286 * List of child posts. This only shows up for carousel posts. 287 */ 288 @java.lang.SuppressWarnings("all") 289 public List<TdMedia> getChildren() { 290 return this.children; 291 } 292 293 /** 294 * List of child posts. This only shows up for carousel posts. 295 */ 296 @java.lang.SuppressWarnings("all") 297 public void setChildren(final List<TdMedia> children) { 298 this.children = children; 299 } 300 301 /** 302 * Indicates if the media is a quoted post made by another user 303 */ 304 @java.lang.SuppressWarnings("all") 305 public Boolean getIsQuotePost() { 306 return this.isQuotePost; 307 } 308 309 /** 310 * Indicates if the media is a quoted post made by another user 311 */ 312 @java.lang.SuppressWarnings("all") 313 public void setIsQuotePost(final Boolean isQuotePost) { 314 this.isQuotePost = isQuotePost; 315 } 316 317 /** 318 * The accessibility text label or description for an image or video in a Threads post 319 */ 320 @java.lang.SuppressWarnings("all") 321 public String getAltText() { 322 return this.altText; 323 } 324 325 /** 326 * The accessibility text label or description for an image or video in a Threads post 327 */ 328 @java.lang.SuppressWarnings("all") 329 public void setAltText(final String altText) { 330 this.altText = altText; 331 } 332 333 @java.lang.SuppressWarnings("all") 334 public List<String> getAllowlistedCountryCodes() { 335 return this.allowlistedCountryCodes; 336 } 337 338 @java.lang.SuppressWarnings("all") 339 public void setAllowlistedCountryCodes(final List<String> allowlistedCountryCodes) { 340 this.allowlistedCountryCodes = allowlistedCountryCodes; 341 } 342 343 /** 344 * link attachment URL of the URL that is attachment with highlight. 345 * See here: https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 346 */ 347 @java.lang.SuppressWarnings("all") 348 public String getLinkAttachmentUrl() { 349 return this.linkAttachmentUrl; 350 } 351 352 /** 353 * link attachment URL of the URL that is attachment with highlight. 354 * See here: https://developers.facebook.com/docs/threads/posts#tags-and-links-in-posts 355 */ 356 @java.lang.SuppressWarnings("all") 357 public void setLinkAttachmentUrl(final String linkAttachmentUrl) { 358 this.linkAttachmentUrl = linkAttachmentUrl; 359 } 360}