001// Generated by delombok at Fri Feb 21 00:22:14 UTC 2025
002/*
003 * Copyright (c) 2010-2025 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 com.restfb.Facebook;
026import com.restfb.types.AbstractFacebookType;
027import java.util.ArrayList;
028import java.util.List;
029
030/**
031 * Represents the
032 * <a href="https://developers.facebook.com/docs/whatsapp/cloud-api/health-status/#response-contents">
033 * Messaging Health Status</a>
034 */
035public class WhatsAppBusinessHealthStatus extends AbstractFacebookType {
036  private static final long serialVersionUID = 1L;
037  // Indicates the overall messaging capability of the business phone number
038  @Facebook("can_send_message")
039  private CanSendMessageStatus canSendMessage;
040  // List of entities and their messaging status
041  @Facebook
042  private List<EntityStatus> entities = new ArrayList<>();
043
044
045  public enum CanSendMessageStatus {
046    AVAILABLE, LIMITED, BLOCKED;
047  }
048
049
050  public enum EntityType {
051    PHONE_NUMBER, WABA, BUSINESS, APP, MESSAGE_TEMPLATE;
052  }
053
054
055  public static class EntityStatus {
056    // Type of entity (PHONE_NUMBER, WABA, BUSINESS, APP, MESSAGE_TEMPLATE)
057    @Facebook("entity_type")
058    private EntityType entityType;
059    // ID of the entity
060    @Facebook
061    private String id;
062    // Messaging capability status of the entity
063    @Facebook("can_send_message")
064    private CanSendMessageStatus canSendMessage;
065    // Additional information about messaging limitations
066    @Facebook("additional_info")
067    private List<String> additionalInfo = new ArrayList<>();
068    // List of errors if the entity is blocked from sending messages
069    @Facebook
070    private List<ErrorDetail> errors = new ArrayList<>();
071
072    @java.lang.SuppressWarnings("all")
073    public EntityType getEntityType() {
074      return this.entityType;
075    }
076
077    @java.lang.SuppressWarnings("all")
078    public void setEntityType(final EntityType entityType) {
079      this.entityType = entityType;
080    }
081
082    @java.lang.SuppressWarnings("all")
083    public String getId() {
084      return this.id;
085    }
086
087    @java.lang.SuppressWarnings("all")
088    public void setId(final String id) {
089      this.id = id;
090    }
091
092    @java.lang.SuppressWarnings("all")
093    public CanSendMessageStatus getCanSendMessage() {
094      return this.canSendMessage;
095    }
096
097    @java.lang.SuppressWarnings("all")
098    public void setCanSendMessage(final CanSendMessageStatus canSendMessage) {
099      this.canSendMessage = canSendMessage;
100    }
101
102    @java.lang.SuppressWarnings("all")
103    public List<String> getAdditionalInfo() {
104      return this.additionalInfo;
105    }
106
107    @java.lang.SuppressWarnings("all")
108    public void setAdditionalInfo(final List<String> additionalInfo) {
109      this.additionalInfo = additionalInfo;
110    }
111
112    @java.lang.SuppressWarnings("all")
113    public List<ErrorDetail> getErrors() {
114      return this.errors;
115    }
116
117    @java.lang.SuppressWarnings("all")
118    public void setErrors(final List<ErrorDetail> errors) {
119      this.errors = errors;
120    }
121  }
122
123
124  public static class ErrorDetail {
125    // Error code representing the specific issue
126    @Facebook("error_code")
127    private int errorCode;
128    // Description of the error
129    @Facebook("error_description")
130    private String errorDescription;
131    // Suggested solution for resolving the error
132    @Facebook("possible_solution")
133    private String possibleSolution;
134
135    @java.lang.SuppressWarnings("all")
136    public int getErrorCode() {
137      return this.errorCode;
138    }
139
140    @java.lang.SuppressWarnings("all")
141    public void setErrorCode(final int errorCode) {
142      this.errorCode = errorCode;
143    }
144
145    @java.lang.SuppressWarnings("all")
146    public String getErrorDescription() {
147      return this.errorDescription;
148    }
149
150    @java.lang.SuppressWarnings("all")
151    public void setErrorDescription(final String errorDescription) {
152      this.errorDescription = errorDescription;
153    }
154
155    @java.lang.SuppressWarnings("all")
156    public String getPossibleSolution() {
157      return this.possibleSolution;
158    }
159
160    @java.lang.SuppressWarnings("all")
161    public void setPossibleSolution(final String possibleSolution) {
162      this.possibleSolution = possibleSolution;
163    }
164  }
165
166  @java.lang.SuppressWarnings("all")
167  public CanSendMessageStatus getCanSendMessage() {
168    return this.canSendMessage;
169  }
170
171  @java.lang.SuppressWarnings("all")
172  public void setCanSendMessage(final CanSendMessageStatus canSendMessage) {
173    this.canSendMessage = canSendMessage;
174  }
175
176  @java.lang.SuppressWarnings("all")
177  public List<EntityStatus> getEntities() {
178    return this.entities;
179  }
180
181  @java.lang.SuppressWarnings("all")
182  public void setEntities(final List<EntityStatus> entities) {
183    this.entities = entities;
184  }
185}