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