001// Generated by delombok at Thu Aug 13 13:56:43 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.ads;
024
025import java.util.ArrayList;
026import java.util.Collections;
027import java.util.Date;
028import java.util.List;
029import com.restfb.Facebook;
030import com.restfb.types.features.HasCreatedTime;
031
032/**
033 * Represents the <a href="https://developers.facebook.com/docs/marketing-api/reference/ad-image">AdGroup Image type</a>
034 */
035public class AdImage extends NamedAdsObject implements HasCreatedTime {
036  private static final long serialVersionUID = 1L;
037  /**
038   * The ad account that owns the image
039   */
040  @Facebook("account_id")
041  private String accountId;
042  /**
043   * The hash which uniquely identifies the image.
044   */
045  @Facebook
046  private String hash;
047  /**
048   * A temporary URL which the image can be retrieved at. NOTE: do not use this URL in ad creative creation
049   */
050  @Facebook
051  private String url;
052  /**
053   * A temporary URL pointing to a version of the image resized to fit withing a 128x128 pixel box
054   */
055  @Facebook("url_128")
056  private String url128;
057  /**
058   * A permanent URL of the image to use in story creatives.
059   */
060  @Facebook("permalink_url")
061  private String permalinkUrl;
062  /**
063   * The width of the image.
064   */
065  @Facebook
066  private String width;
067  /**
068   * The height of the image.
069   */
070  @Facebook
071  private String height;
072  /**
073   * The width of the image that was originally uploaded.
074   */
075  @Facebook("original_width")
076  private String originalWidth;
077  /**
078   * The height of the image that was originally uploaded.
079   */
080  @Facebook("original_height")
081  private String originalHeight;
082  /**
083   * Status of the image
084   */
085  @Facebook
086  private String status;
087  /**
088   * Time the image was created
089   */
090  @Facebook("created_time")
091  private Date createdTime;
092  /**
093   * Time the image was updated
094   */
095  @Facebook("updated_time")
096  private Date updatedTime;
097  private final List<AdCreative> creatives = new ArrayList<>();
098
099  public boolean addCreative(AdCreative creative) {
100    return creatives.add(creative);
101  }
102
103  public boolean removeCreative(AdCreative creative) {
104    return creatives.remove(creative);
105  }
106
107  /**
108   * A list of ad creative IDs that this ad image is being used in.
109   *
110   * @return A list of ad creative IDs that this ad image is being used in
111   */
112  public List<AdCreative> getCreatives() {
113    return Collections.unmodifiableList(creatives);
114  }
115
116  /**
117   * The ad account that owns the image
118   */
119  @java.lang.SuppressWarnings("all")
120  @lombok.Generated
121  public String getAccountId() {
122    return this.accountId;
123  }
124
125  /**
126   * The ad account that owns the image
127   */
128  @java.lang.SuppressWarnings("all")
129  @lombok.Generated
130  public void setAccountId(final String accountId) {
131    this.accountId = accountId;
132  }
133
134  /**
135   * The hash which uniquely identifies the image.
136   */
137  @java.lang.SuppressWarnings("all")
138  @lombok.Generated
139  public String getHash() {
140    return this.hash;
141  }
142
143  /**
144   * The hash which uniquely identifies the image.
145   */
146  @java.lang.SuppressWarnings("all")
147  @lombok.Generated
148  public void setHash(final String hash) {
149    this.hash = hash;
150  }
151
152  /**
153   * A temporary URL which the image can be retrieved at. NOTE: do not use this URL in ad creative creation
154   */
155  @java.lang.SuppressWarnings("all")
156  @lombok.Generated
157  public String getUrl() {
158    return this.url;
159  }
160
161  /**
162   * A temporary URL which the image can be retrieved at. NOTE: do not use this URL in ad creative creation
163   */
164  @java.lang.SuppressWarnings("all")
165  @lombok.Generated
166  public void setUrl(final String url) {
167    this.url = url;
168  }
169
170  /**
171   * A temporary URL pointing to a version of the image resized to fit withing a 128x128 pixel box
172   */
173  @java.lang.SuppressWarnings("all")
174  @lombok.Generated
175  public String getUrl128() {
176    return this.url128;
177  }
178
179  /**
180   * A temporary URL pointing to a version of the image resized to fit withing a 128x128 pixel box
181   */
182  @java.lang.SuppressWarnings("all")
183  @lombok.Generated
184  public void setUrl128(final String url128) {
185    this.url128 = url128;
186  }
187
188  /**
189   * A permanent URL of the image to use in story creatives.
190   */
191  @java.lang.SuppressWarnings("all")
192  @lombok.Generated
193  public String getPermalinkUrl() {
194    return this.permalinkUrl;
195  }
196
197  /**
198   * A permanent URL of the image to use in story creatives.
199   */
200  @java.lang.SuppressWarnings("all")
201  @lombok.Generated
202  public void setPermalinkUrl(final String permalinkUrl) {
203    this.permalinkUrl = permalinkUrl;
204  }
205
206  /**
207   * The width of the image.
208   */
209  @java.lang.SuppressWarnings("all")
210  @lombok.Generated
211  public String getWidth() {
212    return this.width;
213  }
214
215  /**
216   * The width of the image.
217   */
218  @java.lang.SuppressWarnings("all")
219  @lombok.Generated
220  public void setWidth(final String width) {
221    this.width = width;
222  }
223
224  /**
225   * The height of the image.
226   */
227  @java.lang.SuppressWarnings("all")
228  @lombok.Generated
229  public String getHeight() {
230    return this.height;
231  }
232
233  /**
234   * The height of the image.
235   */
236  @java.lang.SuppressWarnings("all")
237  @lombok.Generated
238  public void setHeight(final String height) {
239    this.height = height;
240  }
241
242  /**
243   * The width of the image that was originally uploaded.
244   */
245  @java.lang.SuppressWarnings("all")
246  @lombok.Generated
247  public String getOriginalWidth() {
248    return this.originalWidth;
249  }
250
251  /**
252   * The width of the image that was originally uploaded.
253   */
254  @java.lang.SuppressWarnings("all")
255  @lombok.Generated
256  public void setOriginalWidth(final String originalWidth) {
257    this.originalWidth = originalWidth;
258  }
259
260  /**
261   * The height of the image that was originally uploaded.
262   */
263  @java.lang.SuppressWarnings("all")
264  @lombok.Generated
265  public String getOriginalHeight() {
266    return this.originalHeight;
267  }
268
269  /**
270   * The height of the image that was originally uploaded.
271   */
272  @java.lang.SuppressWarnings("all")
273  @lombok.Generated
274  public void setOriginalHeight(final String originalHeight) {
275    this.originalHeight = originalHeight;
276  }
277
278  /**
279   * Status of the image
280   */
281  @java.lang.SuppressWarnings("all")
282  @lombok.Generated
283  public String getStatus() {
284    return this.status;
285  }
286
287  /**
288   * Status of the image
289   */
290  @java.lang.SuppressWarnings("all")
291  @lombok.Generated
292  public void setStatus(final String status) {
293    this.status = status;
294  }
295
296  /**
297   * Time the image was created
298   */
299  @Override
300  @java.lang.SuppressWarnings("all")
301  @lombok.Generated
302  public Date getCreatedTime() {
303    return this.createdTime;
304  }
305
306  /**
307   * Time the image was created
308   */
309  @java.lang.SuppressWarnings("all")
310  @lombok.Generated
311  public void setCreatedTime(final Date createdTime) {
312    this.createdTime = createdTime;
313  }
314
315  /**
316   * Time the image was updated
317   */
318  @java.lang.SuppressWarnings("all")
319  @lombok.Generated
320  public Date getUpdatedTime() {
321    return this.updatedTime;
322  }
323
324  /**
325   * Time the image was updated
326   */
327  @java.lang.SuppressWarnings("all")
328  @lombok.Generated
329  public void setUpdatedTime(final Date updatedTime) {
330    this.updatedTime = updatedTime;
331  }
332}