001// Generated by delombok at Sun Apr 14 14:59:49 CEST 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.List;
026import com.restfb.Facebook;
027import com.restfb.json.Json;
028import com.restfb.json.JsonObject;
029import com.restfb.types.AbstractFacebookType;
030
031/**
032 * Represents the <a href="https://developers.facebook.com/docs/marketing-api/reachandfrequency/">Reach Frequency Spec
033 * type</a>.
034 */
035public class ReachFrequencySpec extends AbstractFacebookType {
036  @Facebook
037  private List<String> countries;
038  @Facebook("min_campaign_duration")
039  private String minCampaignDuration;
040  @Facebook("max_campaign_duration")
041  private String maxCampaignDuration;
042  @Facebook("max_days_to_finish")
043  private String maxDaysToFinish;
044  @Facebook("min_reach_limits")
045  private String minReachLimits;
046
047  public JsonObject getMinCampaignDuration() {
048    if (minCampaignDuration != null) {
049      return Json.parse(minCampaignDuration).asObject();
050    } else {
051      return null;
052    }
053  }
054
055  public void setMinCampaignDuration(JsonObject minCampaignDuration) {
056    if (minCampaignDuration != null) {
057      this.minCampaignDuration = minCampaignDuration.toString();
058    } else {
059      this.minCampaignDuration = null;
060    }
061  }
062
063  public JsonObject getMaxCampaignDuration() {
064    if (maxCampaignDuration != null) {
065      return Json.parse(maxCampaignDuration).asObject();
066    } else {
067      return null;
068    }
069  }
070
071  public void setMaxCampaignDuration(JsonObject maxCampaignDuration) {
072    if (maxCampaignDuration != null) {
073      this.maxCampaignDuration = maxCampaignDuration.toString();
074    } else {
075      this.maxCampaignDuration = null;
076    }
077  }
078
079  public JsonObject getMaxDaysToFinish() {
080    if (maxDaysToFinish != null) {
081      return Json.parse(maxDaysToFinish).asObject();
082    } else {
083      return null;
084    }
085  }
086
087  public void setMaxDaysToFinish(JsonObject maxDaysToFinish) {
088    if (maxDaysToFinish != null) {
089      this.maxDaysToFinish = maxDaysToFinish.toString();
090    } else {
091      this.maxDaysToFinish = null;
092    }
093  }
094
095  public JsonObject getMinReachLimits() {
096    if (minReachLimits != null) {
097      return Json.parse(minReachLimits).asObject();
098    } else {
099      return null;
100    }
101  }
102
103  public void setMinReachLimits(JsonObject minReachLimits) {
104    if (minReachLimits != null) {
105      this.minReachLimits = minReachLimits.toString();
106    } else {
107      this.minReachLimits = null;
108    }
109  }
110
111  @java.lang.SuppressWarnings("all")
112  public List<String> getCountries() {
113    return this.countries;
114  }
115
116  @java.lang.SuppressWarnings("all")
117  public void setCountries(final List<String> countries) {
118    this.countries = countries;
119  }
120}