001// Generated by delombok at Fri Jun 21 08:44:28 UTC 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.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  public String getAccountId() {
121    return this.accountId;
122  }
123
124  /**
125   * The ad account that owns the image
126   */
127  @java.lang.SuppressWarnings("all")
128  public void setAccountId(final String accountId) {
129    this.accountId = accountId;
130  }
131
132  /**
133   * The hash which uniquely identifies the image.
134   */
135  @java.lang.SuppressWarnings("all")
136  public String getHash() {
137    return this.hash;
138  }
139
140  /**
141   * The hash which uniquely identifies the image.
142   */
143  @java.lang.SuppressWarnings("all")
144  public void setHash(final String hash) {
145    this.hash = hash;
146  }
147
148  /**
149   * A temporary URL which the image can be retrieved at. NOTE: do not use this URL in ad creative creation
150   */
151  @java.lang.SuppressWarnings("all")
152  public String getUrl() {
153    return this.url;
154  }
155
156  /**
157   * A temporary URL which the image can be retrieved at. NOTE: do not use this URL in ad creative creation
158   */
159  @java.lang.SuppressWarnings("all")
160  public void setUrl(final String url) {
161    this.url = url;
162  }
163
164  /**
165   * A temporary URL pointing to a version of the image resized to fit withing a 128x128 pixel box
166   */
167  @java.lang.SuppressWarnings("all")
168  public String getUrl128() {
169    return this.url128;
170  }
171
172  /**
173   * A temporary URL pointing to a version of the image resized to fit withing a 128x128 pixel box
174   */
175  @java.lang.SuppressWarnings("all")
176  public void setUrl128(final String url128) {
177    this.url128 = url128;
178  }
179
180  /**
181   * A permanent URL of the image to use in story creatives.
182   */
183  @java.lang.SuppressWarnings("all")
184  public String getPermalinkUrl() {
185    return this.permalinkUrl;
186  }
187
188  /**
189   * A permanent URL of the image to use in story creatives.
190   */
191  @java.lang.SuppressWarnings("all")
192  public void setPermalinkUrl(final String permalinkUrl) {
193    this.permalinkUrl = permalinkUrl;
194  }
195
196  /**
197   * The width of the image.
198   */
199  @java.lang.SuppressWarnings("all")
200  public String getWidth() {
201    return this.width;
202  }
203
204  /**
205   * The width of the image.
206   */
207  @java.lang.SuppressWarnings("all")
208  public void setWidth(final String width) {
209    this.width = width;
210  }
211
212  /**
213   * The height of the image.
214   */
215  @java.lang.SuppressWarnings("all")
216  public String getHeight() {
217    return this.height;
218  }
219
220  /**
221   * The height of the image.
222   */
223  @java.lang.SuppressWarnings("all")
224  public void setHeight(final String height) {
225    this.height = height;
226  }
227
228  /**
229   * The width of the image that was originally uploaded.
230   */
231  @java.lang.SuppressWarnings("all")
232  public String getOriginalWidth() {
233    return this.originalWidth;
234  }
235
236  /**
237   * The width of the image that was originally uploaded.
238   */
239  @java.lang.SuppressWarnings("all")
240  public void setOriginalWidth(final String originalWidth) {
241    this.originalWidth = originalWidth;
242  }
243
244  /**
245   * The height of the image that was originally uploaded.
246   */
247  @java.lang.SuppressWarnings("all")
248  public String getOriginalHeight() {
249    return this.originalHeight;
250  }
251
252  /**
253   * The height of the image that was originally uploaded.
254   */
255  @java.lang.SuppressWarnings("all")
256  public void setOriginalHeight(final String originalHeight) {
257    this.originalHeight = originalHeight;
258  }
259
260  /**
261   * Status of the image
262   */
263  @java.lang.SuppressWarnings("all")
264  public String getStatus() {
265    return this.status;
266  }
267
268  /**
269   * Status of the image
270   */
271  @java.lang.SuppressWarnings("all")
272  public void setStatus(final String status) {
273    this.status = status;
274  }
275
276  /**
277   * Time the image was created
278   */
279  @Override
280  @java.lang.SuppressWarnings("all")
281  public Date getCreatedTime() {
282    return this.createdTime;
283  }
284
285  /**
286   * Time the image was created
287   */
288  @java.lang.SuppressWarnings("all")
289  public void setCreatedTime(final Date createdTime) {
290    this.createdTime = createdTime;
291  }
292
293  /**
294   * Time the image was updated
295   */
296  @java.lang.SuppressWarnings("all")
297  public Date getUpdatedTime() {
298    return this.updatedTime;
299  }
300
301  /**
302   * Time the image was updated
303   */
304  @java.lang.SuppressWarnings("all")
305  public void setUpdatedTime(final Date updatedTime) {
306    this.updatedTime = updatedTime;
307  }
308}