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