001// Generated by delombok at Fri Oct 04 16:05:59 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.whatsapp;
024
025import java.util.ArrayList;
026import java.util.Collections;
027import java.util.List;
028import com.restfb.Facebook;
029import com.restfb.types.AbstractFacebookType;
030
031/**
032 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/waba-analytics/">WABA (WhatsApp
033 * Business Account) Analytics type </a>
034 */
035public class WABAAnalytics extends AbstractFacebookType {
036  private static final long serialVersionUID = 1L;
037  @Facebook("country_codes")
038  private List<String> countryCodes = new ArrayList<>();
039  @Facebook("data_points")
040  private List<WABAAnalyticsDataPoint> dataPoints = new ArrayList<>();
041  @Facebook
042  private String granularity;
043  @Facebook("phone_numbers")
044  private List<String> phoneNumbers = new ArrayList<>();
045
046  /**
047   * List of ISO 3166 country codes (e.g. US, IN)
048   */
049  public List<String> getCountryCodes() {
050    return Collections.unmodifiableList(countryCodes);
051  }
052
053  public boolean addCountryCode(String countryCode) {
054    return countryCodes.add(countryCode);
055  }
056
057  public boolean removeCountryCode(String countryCode) {
058    return countryCodes.remove(countryCode);
059  }
060
061  /**
062   * List of analytics data points (e.g. {start: 0, end: 10000, sent: 10, delivered: 9})
063   */
064  public List<WABAAnalyticsDataPoint> getDataPoints() {
065    return Collections.unmodifiableList(dataPoints);
066  }
067
068  public boolean addDataPoint(WABAAnalyticsDataPoint dataPoint) {
069    return dataPoints.add(dataPoint);
070  }
071
072  public boolean removeDataPoint(WABAAnalyticsDataPoint dataPoint) {
073    return dataPoints.remove(dataPoint);
074  }
075
076  /**
077   * List of WhatsApp normalized phone numbers (e.g. [16315551000])
078   */
079  public List<String> getPhoneNumbers() {
080    return Collections.unmodifiableList(phoneNumbers);
081  }
082
083  public boolean addPhoneNumber(String phoneNumber) {
084    return phoneNumbers.add(phoneNumber);
085  }
086
087  public boolean removePhoneNumber(String phoneNumber) {
088    return phoneNumbers.remove(phoneNumber);
089  }
090
091  @java.lang.SuppressWarnings("all")
092  public String getGranularity() {
093    return this.granularity;
094  }
095
096  @java.lang.SuppressWarnings("all")
097  public void setGranularity(final String granularity) {
098    this.granularity = granularity;
099  }
100}