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; 024 025import static java.util.Collections.unmodifiableList; 026import java.util.ArrayList; 027import java.util.Collections; 028import java.util.List; 029import com.restfb.Facebook; 030 031/** 032 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/v2.3/story_attachment">Story 033 * Attachment Graph API type</a>. 034 * 035 * @author <a href="https://github.com/kevinleturc/">Kevin Leturc</a> 036 * @since 1.12.0 037 */ 038public class StoryAttachment extends FacebookType { 039 /** 040 * Returns text accompanying the attachment. 041 */ 042 @Facebook 043 private String description; 044 /** 045 * Returns media object (photo, link etc.) contained in the attachment. 046 */ 047 @Facebook 048 private Media media; 049 /** 050 * Type of the media such as (photo, video, link etc) 051 */ 052 @Facebook("media_type") 053 private String mediaType; 054 /** 055 * Returns object that the attachment links to. 056 */ 057 @Facebook 058 private Target target; 059 /** 060 * Returns title of the attachment. 061 */ 062 @Facebook 063 private String title; 064 /** 065 * Returns URL of the attachment. 066 */ 067 @Facebook 068 private String url; 069 /** 070 * Unshimmed URL of the attachment. 071 */ 072 @Facebook("unshimmed_url") 073 private String unshimmedUrl; 074 /** 075 * Returns list of subattachments that are associated with this attachment. 076 */ 077 @Facebook("subattachments") 078 private Attachments subAttachments; 079 @Facebook("description_tags") 080 private List<EntityAtTextRange> descriptionTags = new ArrayList<>(); 081 private static final long serialVersionUID = 1L; 082 083 /** 084 * Profiles tagged in the text accompanying the attachment 085 * 086 * @return Profiles tagged in the text accompanying the attachment 087 */ 088 public List<EntityAtTextRange> getDescriptionTags() { 089 return Collections.unmodifiableList(descriptionTags); 090 } 091 092 public boolean addDescriptionTag(EntityAtTextRange entityAtTextRange) { 093 return descriptionTags.add(entityAtTextRange); 094 } 095 096 public boolean removeDescriptionTag(EntityAtTextRange entityAtTextRange) { 097 return descriptionTags.remove(entityAtTextRange); 098 } 099 100 101 /** 102 * Represents the list of subattachments that are associated with this attachment. This will have data if the parent 103 * attachment is a container for multiple other attachments. For example, a multi-photo story will have a parent 104 * attachment representing an upload of multiple photos to an album where each subattachment will contain the actual 105 * photos that were uploaded. 106 * 107 * @author <a href="https://github.com/kevinleturc/">Kevin Leturc</a> 108 */ 109 public static class Attachments extends AbstractFacebookType { 110 @Facebook 111 private List<StoryAttachment> data = new ArrayList<>(); 112 private static final long serialVersionUID = 1L; 113 114 /** 115 * The attachments. 116 * 117 * @return The attachments. 118 */ 119 public List<StoryAttachment> getData() { 120 return unmodifiableList(data); 121 } 122 123 public boolean addData(StoryAttachment attachment) { 124 return data.add(attachment); 125 } 126 127 public boolean removeData(StoryAttachment attachment) { 128 return data.remove(attachment); 129 } 130 } 131 132 133 /** 134 * Media data as applicable for the attachment. 135 * 136 * @author <a href="https://github.com/kevinleturc/">Kevin Leturc</a> 137 */ 138 public static class Media extends FacebookType { 139 private static final long serialVersionUID = 1L; 140 @Facebook 141 private Image image; 142 @Facebook 143 private String source; 144 145 @java.lang.SuppressWarnings("all") 146 @lombok.Generated 147 public Image getImage() { 148 return this.image; 149 } 150 151 @java.lang.SuppressWarnings("all") 152 @lombok.Generated 153 public void setImage(final Image image) { 154 this.image = image; 155 } 156 157 @java.lang.SuppressWarnings("all") 158 @lombok.Generated 159 public String getSource() { 160 return this.source; 161 } 162 163 @java.lang.SuppressWarnings("all") 164 @lombok.Generated 165 public void setSource(final String source) { 166 this.source = source; 167 } 168 } 169 170 171 /** 172 * Image data as applicable for the attachment 173 * 174 * @author <a href="https://github.com/kevinleturc/">Kevin Leturc</a> 175 */ 176 public static class Image extends FacebookType { 177 private static final long serialVersionUID = 1L; 178 @Facebook 179 private Integer height; 180 @Facebook 181 private Integer width; 182 @Facebook 183 private String src; 184 185 @java.lang.SuppressWarnings("all") 186 @lombok.Generated 187 public Integer getHeight() { 188 return this.height; 189 } 190 191 @java.lang.SuppressWarnings("all") 192 @lombok.Generated 193 public void setHeight(final Integer height) { 194 this.height = height; 195 } 196 197 @java.lang.SuppressWarnings("all") 198 @lombok.Generated 199 public Integer getWidth() { 200 return this.width; 201 } 202 203 @java.lang.SuppressWarnings("all") 204 @lombok.Generated 205 public void setWidth(final Integer width) { 206 this.width = width; 207 } 208 209 @java.lang.SuppressWarnings("all") 210 @lombok.Generated 211 public String getSrc() { 212 return this.src; 213 } 214 215 @java.lang.SuppressWarnings("all") 216 @lombok.Generated 217 public void setSrc(final String src) { 218 this.src = src; 219 } 220 } 221 222 223 /** 224 * Target data as applicable for the attachment 225 * 226 * @author <a href="https://github.com/kevinleturc/">Kevin Leturc</a> 227 */ 228 public static class Target extends FacebookType { 229 private static final long serialVersionUID = 1L; 230 @Facebook 231 private String url; 232 @Facebook("unshimmed_url") 233 private String unshimmedUrl; 234 235 @java.lang.SuppressWarnings("all") 236 @lombok.Generated 237 public String getUrl() { 238 return this.url; 239 } 240 241 @java.lang.SuppressWarnings("all") 242 @lombok.Generated 243 public void setUrl(final String url) { 244 this.url = url; 245 } 246 247 @java.lang.SuppressWarnings("all") 248 @lombok.Generated 249 public String getUnshimmedUrl() { 250 return this.unshimmedUrl; 251 } 252 253 @java.lang.SuppressWarnings("all") 254 @lombok.Generated 255 public void setUnshimmedUrl(final String unshimmedUrl) { 256 this.unshimmedUrl = unshimmedUrl; 257 } 258 } 259 260 /** 261 * Returns text accompanying the attachment. 262 * 263 * @return Text accompanying the attachment. 264 */ 265 @java.lang.SuppressWarnings("all") 266 @lombok.Generated 267 public String getDescription() { 268 return this.description; 269 } 270 271 /** 272 * Returns text accompanying the attachment. 273 */ 274 @java.lang.SuppressWarnings("all") 275 @lombok.Generated 276 public void setDescription(final String description) { 277 this.description = description; 278 } 279 280 /** 281 * Returns media object (photo, link etc.) contained in the attachment. 282 * 283 * @return Media object (photo, link etc.) contained in the attachment. 284 */ 285 @java.lang.SuppressWarnings("all") 286 @lombok.Generated 287 public Media getMedia() { 288 return this.media; 289 } 290 291 /** 292 * Returns media object (photo, link etc.) contained in the attachment. 293 */ 294 @java.lang.SuppressWarnings("all") 295 @lombok.Generated 296 public void setMedia(final Media media) { 297 this.media = media; 298 } 299 300 /** 301 * Type of the media such as (photo, video, link etc) 302 * 303 * @return Type of the media such as (photo, video, link etc) 304 */ 305 @java.lang.SuppressWarnings("all") 306 @lombok.Generated 307 public String getMediaType() { 308 return this.mediaType; 309 } 310 311 /** 312 * Type of the media such as (photo, video, link etc) 313 */ 314 @java.lang.SuppressWarnings("all") 315 @lombok.Generated 316 public void setMediaType(final String mediaType) { 317 this.mediaType = mediaType; 318 } 319 320 /** 321 * Returns object that the attachment links to. 322 * 323 * @return Object that the attachment links to. 324 */ 325 @java.lang.SuppressWarnings("all") 326 @lombok.Generated 327 public Target getTarget() { 328 return this.target; 329 } 330 331 /** 332 * Returns object that the attachment links to. 333 */ 334 @java.lang.SuppressWarnings("all") 335 @lombok.Generated 336 public void setTarget(final Target target) { 337 this.target = target; 338 } 339 340 /** 341 * Returns title of the attachment. 342 * 343 * @return Title of the attachment. 344 */ 345 @java.lang.SuppressWarnings("all") 346 @lombok.Generated 347 public String getTitle() { 348 return this.title; 349 } 350 351 /** 352 * Returns title of the attachment. 353 */ 354 @java.lang.SuppressWarnings("all") 355 @lombok.Generated 356 public void setTitle(final String title) { 357 this.title = title; 358 } 359 360 /** 361 * Returns URL of the attachment. 362 * 363 * @return URL of the attachment. 364 */ 365 @java.lang.SuppressWarnings("all") 366 @lombok.Generated 367 public String getUrl() { 368 return this.url; 369 } 370 371 /** 372 * Returns URL of the attachment. 373 */ 374 @java.lang.SuppressWarnings("all") 375 @lombok.Generated 376 public void setUrl(final String url) { 377 this.url = url; 378 } 379 380 /** 381 * Unshimmed URL of the attachment. 382 * 383 * @return Unshimmed URL of the attachment 384 */ 385 @java.lang.SuppressWarnings("all") 386 @lombok.Generated 387 public String getUnshimmedUrl() { 388 return this.unshimmedUrl; 389 } 390 391 /** 392 * Unshimmed URL of the attachment. 393 */ 394 @java.lang.SuppressWarnings("all") 395 @lombok.Generated 396 public void setUnshimmedUrl(final String unshimmedUrl) { 397 this.unshimmedUrl = unshimmedUrl; 398 } 399 400 /** 401 * Returns list of subattachments that are associated with this attachment. 402 * 403 * @return List of subattachments that are associated with this attachment. 404 */ 405 @java.lang.SuppressWarnings("all") 406 @lombok.Generated 407 public Attachments getSubAttachments() { 408 return this.subAttachments; 409 } 410 411 /** 412 * Returns list of subattachments that are associated with this attachment. 413 */ 414 @java.lang.SuppressWarnings("all") 415 @lombok.Generated 416 public void setSubAttachments(final Attachments subAttachments) { 417 this.subAttachments = subAttachments; 418 } 419}