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