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/graph-api/reference/whats-app-business-hsm-whats-app-hsm-component-get/">
033 * WhatsApp Business HSMWhats App HSMComponent Get</a>, based on
034 * <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/components">
035 * Template Components</a>
036 */
037public class WhatsAppMessageTemplateComponent extends AbstractFacebookType {
038  private static final long serialVersionUID = 1L;
039  /**
040   * Component type.
041   */
042  @Facebook
043  private Type type;
044  /**
045   * Indicates media asset type for the component type
046   */
047  @Facebook
048  private Format format;
049  /**
050   * Component text. Required for components with type HEADER, BODY or FOOTER.
051   */
052  @Facebook
053  private String text;
054  /**
055   * Whether a security recommendation is included in the body text.
056   */
057  @Facebook("add_security_recommendation")
058  private Boolean addSecurityRecommendation;
059  /**
060   * The number of minutes that the authentication code will expire in. (minimum 1, maximum 90)
061   */
062  @Facebook("code_expiration_minutes")
063  private Integer codeExpirationMinutes;
064  /**
065   * The illustrative sample text for the parameter.
066   * Applies only if the component has parameters.
067   */
068  @Facebook
069  private Example example;
070  /**
071   * Button components to be used in the template.
072   */
073  @Facebook
074  private List<Button> buttons = new ArrayList<>();
075
076
077  public enum Type {
078    HEADER, BODY, FOOTER, BUTTONS;
079  }
080
081
082  public enum Format {
083    TEXT, IMAGE, DOCUMENT, VIDEO, LOCATION;
084  }
085
086
087  public enum ButtonType {
088    QUICK_REPLY, URL, PHONE_NUMBER, COPY_CODE, FLOW, MPM, SPM;
089  }
090
091
092  public static class Button {
093    /**
094     * Button type.
095     */
096    @Facebook
097    private ButtonType type;
098    /**
099     * Button label text.
100     */
101    @Facebook
102    private String text;
103    /**
104     * URL of website. Supports 1 variable.
105     */
106    @Facebook
107    private String url;
108    @Facebook("phone_number")
109    private String phoneNumber;
110    /**
111     * Single element list with the strings to copy to the device's clipboard if the type is 'COPY_CODE',
112     * or sample URL if the type is 'URL' and has a parameter.
113     */
114    @Facebook
115    private List<String> example;
116    /**
117     * Unique identifier of the Flow provided by WhatsApp.
118     * The Flow must be published.
119     */
120    @Facebook("flow_id")
121    private String flowId;
122    /**
123     * The name of the Flow, supported in Cloud API only.
124     * Cannot be used with flow_id or flow_json.
125     */
126    @Facebook("flow_name")
127    private String flowName;
128    /**
129     * JSON string specifying the layout of the Flow.
130     * Cannot be used with flow_id or flow_name.
131     */
132    @Facebook("flow_json")
133    private String flowJson;
134    /**
135     * Action to define the Flow behavior.
136     * Can be 'navigate' for predefined screens or 'data_exchange' for dynamic screens.
137     */
138    @Facebook("flow_action")
139    private String flowAction;
140    /**
141     * ID of the entry screen in the Flow if flow_action is 'navigate'.
142     * Optional. Default is 'FIRST_ENTRY_SCREEN'.
143     */
144    @Facebook("navigate_screen")
145    private String navigateScreen;
146
147    /**
148     * Button type.
149     */
150    @java.lang.SuppressWarnings("all")
151    public ButtonType getType() {
152      return this.type;
153    }
154
155    /**
156     * Button type.
157     */
158    @java.lang.SuppressWarnings("all")
159    public void setType(final ButtonType type) {
160      this.type = type;
161    }
162
163    /**
164     * Button label text.
165     */
166    @java.lang.SuppressWarnings("all")
167    public String getText() {
168      return this.text;
169    }
170
171    /**
172     * Button label text.
173     */
174    @java.lang.SuppressWarnings("all")
175    public void setText(final String text) {
176      this.text = text;
177    }
178
179    /**
180     * URL of website. Supports 1 variable.
181     */
182    @java.lang.SuppressWarnings("all")
183    public String getUrl() {
184      return this.url;
185    }
186
187    /**
188     * URL of website. Supports 1 variable.
189     */
190    @java.lang.SuppressWarnings("all")
191    public void setUrl(final String url) {
192      this.url = url;
193    }
194
195    @java.lang.SuppressWarnings("all")
196    public String getPhoneNumber() {
197      return this.phoneNumber;
198    }
199
200    @java.lang.SuppressWarnings("all")
201    public void setPhoneNumber(final String phoneNumber) {
202      this.phoneNumber = phoneNumber;
203    }
204
205    /**
206     * Single element list with the strings to copy to the device's clipboard if the type is 'COPY_CODE',
207     * or sample URL if the type is 'URL' and has a parameter.
208     */
209    @java.lang.SuppressWarnings("all")
210    public List<String> getExample() {
211      return this.example;
212    }
213
214    /**
215     * Single element list with the strings to copy to the device's clipboard if the type is 'COPY_CODE',
216     * or sample URL if the type is 'URL' and has a parameter.
217     */
218    @java.lang.SuppressWarnings("all")
219    public void setExample(final List<String> example) {
220      this.example = example;
221    }
222
223    /**
224     * Unique identifier of the Flow provided by WhatsApp.
225     * The Flow must be published.
226     */
227    @java.lang.SuppressWarnings("all")
228    public String getFlowId() {
229      return this.flowId;
230    }
231
232    /**
233     * Unique identifier of the Flow provided by WhatsApp.
234     * The Flow must be published.
235     */
236    @java.lang.SuppressWarnings("all")
237    public void setFlowId(final String flowId) {
238      this.flowId = flowId;
239    }
240
241    /**
242     * The name of the Flow, supported in Cloud API only.
243     * Cannot be used with flow_id or flow_json.
244     */
245    @java.lang.SuppressWarnings("all")
246    public String getFlowName() {
247      return this.flowName;
248    }
249
250    /**
251     * The name of the Flow, supported in Cloud API only.
252     * Cannot be used with flow_id or flow_json.
253     */
254    @java.lang.SuppressWarnings("all")
255    public void setFlowName(final String flowName) {
256      this.flowName = flowName;
257    }
258
259    /**
260     * JSON string specifying the layout of the Flow.
261     * Cannot be used with flow_id or flow_name.
262     */
263    @java.lang.SuppressWarnings("all")
264    public String getFlowJson() {
265      return this.flowJson;
266    }
267
268    /**
269     * JSON string specifying the layout of the Flow.
270     * Cannot be used with flow_id or flow_name.
271     */
272    @java.lang.SuppressWarnings("all")
273    public void setFlowJson(final String flowJson) {
274      this.flowJson = flowJson;
275    }
276
277    /**
278     * Action to define the Flow behavior.
279     * Can be 'navigate' for predefined screens or 'data_exchange' for dynamic screens.
280     */
281    @java.lang.SuppressWarnings("all")
282    public String getFlowAction() {
283      return this.flowAction;
284    }
285
286    /**
287     * Action to define the Flow behavior.
288     * Can be 'navigate' for predefined screens or 'data_exchange' for dynamic screens.
289     */
290    @java.lang.SuppressWarnings("all")
291    public void setFlowAction(final String flowAction) {
292      this.flowAction = flowAction;
293    }
294
295    /**
296     * ID of the entry screen in the Flow if flow_action is 'navigate'.
297     * Optional. Default is 'FIRST_ENTRY_SCREEN'.
298     */
299    @java.lang.SuppressWarnings("all")
300    public String getNavigateScreen() {
301      return this.navigateScreen;
302    }
303
304    /**
305     * ID of the entry screen in the Flow if flow_action is 'navigate'.
306     * Optional. Default is 'FIRST_ENTRY_SCREEN'.
307     */
308    @java.lang.SuppressWarnings("all")
309    public void setNavigateScreen(final String navigateScreen) {
310      this.navigateScreen = navigateScreen;
311    }
312  }
313
314
315  public static class Example {
316    @Facebook("header_text")
317    private List<String> headerText = new ArrayList<>();
318    @Facebook("header_handle")
319    private List<String> headerHandle = new ArrayList<>();
320    @Facebook("body_text_named_params")
321    private List<NamedParam> bodyTextNamedParams = new ArrayList<>();
322    @Facebook("header_text_named_params")
323    private List<NamedParam> headerTextNamedParams = new ArrayList<>();
324
325    @java.lang.SuppressWarnings("all")
326    public List<String> getHeaderText() {
327      return this.headerText;
328    }
329
330    @java.lang.SuppressWarnings("all")
331    public void setHeaderText(final List<String> headerText) {
332      this.headerText = headerText;
333    }
334
335    @java.lang.SuppressWarnings("all")
336    public List<String> getHeaderHandle() {
337      return this.headerHandle;
338    }
339
340    @java.lang.SuppressWarnings("all")
341    public void setHeaderHandle(final List<String> headerHandle) {
342      this.headerHandle = headerHandle;
343    }
344
345    @java.lang.SuppressWarnings("all")
346    public List<NamedParam> getBodyTextNamedParams() {
347      return this.bodyTextNamedParams;
348    }
349
350    @java.lang.SuppressWarnings("all")
351    public void setBodyTextNamedParams(final List<NamedParam> bodyTextNamedParams) {
352      this.bodyTextNamedParams = bodyTextNamedParams;
353    }
354
355    @java.lang.SuppressWarnings("all")
356    public List<NamedParam> getHeaderTextNamedParams() {
357      return this.headerTextNamedParams;
358    }
359
360    @java.lang.SuppressWarnings("all")
361    public void setHeaderTextNamedParams(final List<NamedParam> headerTextNamedParams) {
362      this.headerTextNamedParams = headerTextNamedParams;
363    }
364  }
365
366
367  public static class NamedParam {
368    @Facebook("param_name")
369    private String paramName;
370    @Facebook
371    private String example;
372
373    @java.lang.SuppressWarnings("all")
374    public String getParamName() {
375      return this.paramName;
376    }
377
378    @java.lang.SuppressWarnings("all")
379    public void setParamName(final String paramName) {
380      this.paramName = paramName;
381    }
382
383    @java.lang.SuppressWarnings("all")
384    public String getExample() {
385      return this.example;
386    }
387
388    @java.lang.SuppressWarnings("all")
389    public void setExample(final String example) {
390      this.example = example;
391    }
392  }
393
394  /**
395   * Component type.
396   */
397  @java.lang.SuppressWarnings("all")
398  public Type getType() {
399    return this.type;
400  }
401
402  /**
403   * Component type.
404   */
405  @java.lang.SuppressWarnings("all")
406  public void setType(final Type type) {
407    this.type = type;
408  }
409
410  /**
411   * Indicates media asset type for the component type
412   */
413  @java.lang.SuppressWarnings("all")
414  public Format getFormat() {
415    return this.format;
416  }
417
418  /**
419   * Indicates media asset type for the component type
420   */
421  @java.lang.SuppressWarnings("all")
422  public void setFormat(final Format format) {
423    this.format = format;
424  }
425
426  /**
427   * Component text. Required for components with type HEADER, BODY or FOOTER.
428   */
429  @java.lang.SuppressWarnings("all")
430  public String getText() {
431    return this.text;
432  }
433
434  /**
435   * Component text. Required for components with type HEADER, BODY or FOOTER.
436   */
437  @java.lang.SuppressWarnings("all")
438  public void setText(final String text) {
439    this.text = text;
440  }
441
442  /**
443   * Whether a security recommendation is included in the body text.
444   */
445  @java.lang.SuppressWarnings("all")
446  public Boolean getAddSecurityRecommendation() {
447    return this.addSecurityRecommendation;
448  }
449
450  /**
451   * Whether a security recommendation is included in the body text.
452   */
453  @java.lang.SuppressWarnings("all")
454  public void setAddSecurityRecommendation(final Boolean addSecurityRecommendation) {
455    this.addSecurityRecommendation = addSecurityRecommendation;
456  }
457
458  /**
459   * The number of minutes that the authentication code will expire in. (minimum 1, maximum 90)
460   */
461  @java.lang.SuppressWarnings("all")
462  public Integer getCodeExpirationMinutes() {
463    return this.codeExpirationMinutes;
464  }
465
466  /**
467   * The number of minutes that the authentication code will expire in. (minimum 1, maximum 90)
468   */
469  @java.lang.SuppressWarnings("all")
470  public void setCodeExpirationMinutes(final Integer codeExpirationMinutes) {
471    this.codeExpirationMinutes = codeExpirationMinutes;
472  }
473
474  /**
475   * The illustrative sample text for the parameter.
476   * Applies only if the component has parameters.
477   */
478  @java.lang.SuppressWarnings("all")
479  public Example getExample() {
480    return this.example;
481  }
482
483  /**
484   * The illustrative sample text for the parameter.
485   * Applies only if the component has parameters.
486   */
487  @java.lang.SuppressWarnings("all")
488  public void setExample(final Example example) {
489    this.example = example;
490  }
491
492  /**
493   * Button components to be used in the template.
494   */
495  @java.lang.SuppressWarnings("all")
496  public List<Button> getButtons() {
497    return this.buttons;
498  }
499
500  /**
501   * Button components to be used in the template.
502   */
503  @java.lang.SuppressWarnings("all")
504  public void setButtons(final List<Button> buttons) {
505    this.buttons = buttons;
506  }
507}