001// Generated by delombok at Wed Oct 13 22:31:21 CEST 2021
002/*
003 * Copyright (c) 2010-2021 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.HashMap;
026import java.util.Map;
027import com.restfb.Facebook;
028import com.restfb.JsonMapper;
029import com.restfb.types.AbstractFacebookType;
030
031public class TargetingResponseGeographicMetadata extends AbstractFacebookType {
032  @Facebook
033  private String data;
034  private MetaData metaData;
035
036  public Map<String, TargetingResponseGeographic> getCountries() {
037    return metaData.getCountries();
038  }
039
040  public Map<String, TargetingResponseGeographic> getRegions() {
041    return metaData.getRegions();
042  }
043
044  public Map<String, TargetingResponseGeographic> getCities() {
045    return metaData.getCities();
046  }
047
048  public Map<String, TargetingResponseGeographic> getZips() {
049    return metaData.getZips();
050  }
051
052  public Map<String, TargetingResponseGeographic> getPlaces() {
053    return metaData.getPlaces();
054  }
055
056  public Map<String, TargetingResponseGeographic> getCustomLocations() {
057    return metaData.getCustomLocations();
058  }
059
060  public Map<String, TargetingResponseGeographic> getGeoMarkets() {
061    return metaData.getGeoMarkets();
062  }
063
064  public Map<String, TargetingResponseGeographic> getElectoralDistricts() {
065    return metaData.getElectoralDistricts();
066  }
067
068  @JsonMapper.JsonMappingCompleted
069  void convertData(JsonMapper mapper) {
070    if (data != null) {
071      metaData = mapper.toJavaObject(data, MetaData.class);
072    }
073  }
074
075
076  private static class MetaData extends AbstractFacebookType {
077    @Facebook
078    private Map<String, TargetingResponseGeographic> countries = new HashMap<>();
079    @Facebook
080    private Map<String, TargetingResponseGeographic> regions = new HashMap<>();
081    @Facebook
082    private Map<String, TargetingResponseGeographic> cities = new HashMap<>();
083    @Facebook
084    private Map<String, TargetingResponseGeographic> zips = new HashMap<>();
085    @Facebook
086    private Map<String, TargetingResponseGeographic> places = new HashMap<>();
087    @Facebook("custom_locations")
088    private Map<String, TargetingResponseGeographic> customLocations = new HashMap<>();
089    @Facebook("geo_markets")
090    private Map<String, TargetingResponseGeographic> geoMarkets = new HashMap<>();
091    @Facebook("electoral_districts")
092    private Map<String, TargetingResponseGeographic> electoralDistricts = new HashMap<String, TargetingResponseGeographic>();
093
094    @java.lang.SuppressWarnings("all")
095    public Map<String, TargetingResponseGeographic> getCountries() {
096      return this.countries;
097    }
098
099    @java.lang.SuppressWarnings("all")
100    public Map<String, TargetingResponseGeographic> getRegions() {
101      return this.regions;
102    }
103
104    @java.lang.SuppressWarnings("all")
105    public Map<String, TargetingResponseGeographic> getCities() {
106      return this.cities;
107    }
108
109    @java.lang.SuppressWarnings("all")
110    public Map<String, TargetingResponseGeographic> getZips() {
111      return this.zips;
112    }
113
114    @java.lang.SuppressWarnings("all")
115    public Map<String, TargetingResponseGeographic> getPlaces() {
116      return this.places;
117    }
118
119    @java.lang.SuppressWarnings("all")
120    public Map<String, TargetingResponseGeographic> getCustomLocations() {
121      return this.customLocations;
122    }
123
124    @java.lang.SuppressWarnings("all")
125    public Map<String, TargetingResponseGeographic> getGeoMarkets() {
126      return this.geoMarkets;
127    }
128
129    @java.lang.SuppressWarnings("all")
130    public Map<String, TargetingResponseGeographic> getElectoralDistricts() {
131      return this.electoralDistricts;
132    }
133  }
134}