001// Generated by delombok at Thu Mar 06 11:40:43 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")
321    private List<List<String>> bodyText = new ArrayList<>();
322    @Facebook("body_text_named_params")
323    private List<NamedParam> bodyTextNamedParams = new ArrayList<>();
324    @Facebook("header_text_named_params")
325    private List<NamedParam> headerTextNamedParams = new ArrayList<>();
326
327    @java.lang.SuppressWarnings("all")
328    public List<String> getHeaderText() {
329      return this.headerText;
330    }
331
332    @java.lang.SuppressWarnings("all")
333    public void setHeaderText(final List<String> headerText) {
334      this.headerText = headerText;
335    }
336
337    @java.lang.SuppressWarnings("all")
338    public List<String> getHeaderHandle() {
339      return this.headerHandle;
340    }
341
342    @java.lang.SuppressWarnings("all")
343    public void setHeaderHandle(final List<String> headerHandle) {
344      this.headerHandle = headerHandle;
345    }
346
347    @java.lang.SuppressWarnings("all")
348    public List<List<String>> getBodyText() {
349      return this.bodyText;
350    }
351
352    @java.lang.SuppressWarnings("all")
353    public void setBodyText(final List<List<String>> bodyText) {
354      this.bodyText = bodyText;
355    }
356
357    @java.lang.SuppressWarnings("all")
358    public List<NamedParam> getBodyTextNamedParams() {
359      return this.bodyTextNamedParams;
360    }
361
362    @java.lang.SuppressWarnings("all")
363    public void setBodyTextNamedParams(final List<NamedParam> bodyTextNamedParams) {
364      this.bodyTextNamedParams = bodyTextNamedParams;
365    }
366
367    @java.lang.SuppressWarnings("all")
368    public List<NamedParam> getHeaderTextNamedParams() {
369      return this.headerTextNamedParams;
370    }
371
372    @java.lang.SuppressWarnings("all")
373    public void setHeaderTextNamedParams(final List<NamedParam> headerTextNamedParams) {
374      this.headerTextNamedParams = headerTextNamedParams;
375    }
376  }
377
378
379  public static class NamedParam {
380    @Facebook("param_name")
381    private String paramName;
382    @Facebook
383    private String example;
384
385    @java.lang.SuppressWarnings("all")
386    public String getParamName() {
387      return this.paramName;
388    }
389
390    @java.lang.SuppressWarnings("all")
391    public void setParamName(final String paramName) {
392      this.paramName = paramName;
393    }
394
395    @java.lang.SuppressWarnings("all")
396    public String getExample() {
397      return this.example;
398    }
399
400    @java.lang.SuppressWarnings("all")
401    public void setExample(final String example) {
402      this.example = example;
403    }
404  }
405
406  /**
407   * Component type.
408   */
409  @java.lang.SuppressWarnings("all")
410  public Type getType() {
411    return this.type;
412  }
413
414  /**
415   * Component type.
416   */
417  @java.lang.SuppressWarnings("all")
418  public void setType(final Type type) {
419    this.type = type;
420  }
421
422  /**
423   * Indicates media asset type for the component type
424   */
425  @java.lang.SuppressWarnings("all")
426  public Format getFormat() {
427    return this.format;
428  }
429
430  /**
431   * Indicates media asset type for the component type
432   */
433  @java.lang.SuppressWarnings("all")
434  public void setFormat(final Format format) {
435    this.format = format;
436  }
437
438  /**
439   * Component text. Required for components with type HEADER, BODY or FOOTER.
440   */
441  @java.lang.SuppressWarnings("all")
442  public String getText() {
443    return this.text;
444  }
445
446  /**
447   * Component text. Required for components with type HEADER, BODY or FOOTER.
448   */
449  @java.lang.SuppressWarnings("all")
450  public void setText(final String text) {
451    this.text = text;
452  }
453
454  /**
455   * Whether a security recommendation is included in the body text.
456   */
457  @java.lang.SuppressWarnings("all")
458  public Boolean getAddSecurityRecommendation() {
459    return this.addSecurityRecommendation;
460  }
461
462  /**
463   * Whether a security recommendation is included in the body text.
464   */
465  @java.lang.SuppressWarnings("all")
466  public void setAddSecurityRecommendation(final Boolean addSecurityRecommendation) {
467    this.addSecurityRecommendation = addSecurityRecommendation;
468  }
469
470  /**
471   * The number of minutes that the authentication code will expire in. (minimum 1, maximum 90)
472   */
473  @java.lang.SuppressWarnings("all")
474  public Integer getCodeExpirationMinutes() {
475    return this.codeExpirationMinutes;
476  }
477
478  /**
479   * The number of minutes that the authentication code will expire in. (minimum 1, maximum 90)
480   */
481  @java.lang.SuppressWarnings("all")
482  public void setCodeExpirationMinutes(final Integer codeExpirationMinutes) {
483    this.codeExpirationMinutes = codeExpirationMinutes;
484  }
485
486  /**
487   * The illustrative sample text for the parameter.
488   * Applies only if the component has parameters.
489   */
490  @java.lang.SuppressWarnings("all")
491  public Example getExample() {
492    return this.example;
493  }
494
495  /**
496   * The illustrative sample text for the parameter.
497   * Applies only if the component has parameters.
498   */
499  @java.lang.SuppressWarnings("all")
500  public void setExample(final Example example) {
501    this.example = example;
502  }
503
504  /**
505   * Button components to be used in the template.
506   */
507  @java.lang.SuppressWarnings("all")
508  public List<Button> getButtons() {
509    return this.buttons;
510  }
511
512  /**
513   * Button components to be used in the template.
514   */
515  @java.lang.SuppressWarnings("all")
516  public void setButtons(final List<Button> buttons) {
517    this.buttons = buttons;
518  }
519}