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.send; 024 025import java.util.ArrayList; 026import java.util.Collections; 027import java.util.List; 028import com.restfb.Facebook; 029 030/** 031 * Represents the 032 * <a href="https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template">Receipt 033 * Template Payload</a> type 034 */ 035public class ReceiptTemplatePayload extends SharableTemplatePayload { 036 @Facebook("recipient_name") 037 private String recipientName; 038 @Facebook("order_number") 039 private String orderNumber; 040 @Facebook 041 private String currency; 042 @Facebook("merchant_name") 043 private String merchantName; 044 @Facebook("payment_method") 045 private String paymentMethod; 046 @Facebook("order_url") 047 private String orderUrl; 048 @Facebook 049 private Long timestamp; 050 @Facebook 051 private List<ReceiptElement> elements; 052 @Facebook 053 private ReceiptAddress address; 054 @Facebook 055 private ReceiptSummary summary; 056 @Facebook 057 private List<ReceiptAdjustment> adjustments; 058 059 public ReceiptTemplatePayload(String recipientName, String orderNumber, String currency, String paymentMethod, ReceiptSummary summary) { 060 this.recipientName = recipientName; 061 this.orderNumber = orderNumber; 062 this.currency = currency; 063 this.paymentMethod = paymentMethod; 064 this.summary = summary; 065 setTemplateType("receipt"); 066 } 067 068 public boolean addElement(ReceiptElement element) { 069 if (elements == null) { 070 elements = new ArrayList<>(); 071 } 072 return elements.add(element); 073 } 074 075 public boolean addAdjustment(ReceiptAdjustment adjustment) { 076 if (adjustments == null) { 077 adjustments = new ArrayList<>(); 078 } 079 return adjustments.add(adjustment); 080 } 081 082 public List<ReceiptElement> getElements() { 083 return Collections.unmodifiableList(elements); 084 } 085 086 public List<ReceiptAdjustment> getAdjustments() { 087 return Collections.unmodifiableList(adjustments); 088 } 089 090 @java.lang.SuppressWarnings("all") 091 @lombok.Generated 092 public String getRecipientName() { 093 return this.recipientName; 094 } 095 096 @java.lang.SuppressWarnings("all") 097 @lombok.Generated 098 public String getOrderNumber() { 099 return this.orderNumber; 100 } 101 102 @java.lang.SuppressWarnings("all") 103 @lombok.Generated 104 public String getCurrency() { 105 return this.currency; 106 } 107 108 @java.lang.SuppressWarnings("all") 109 @lombok.Generated 110 public String getMerchantName() { 111 return this.merchantName; 112 } 113 114 @java.lang.SuppressWarnings("all") 115 @lombok.Generated 116 public void setMerchantName(final String merchantName) { 117 this.merchantName = merchantName; 118 } 119 120 @java.lang.SuppressWarnings("all") 121 @lombok.Generated 122 public String getPaymentMethod() { 123 return this.paymentMethod; 124 } 125 126 @java.lang.SuppressWarnings("all") 127 @lombok.Generated 128 public String getOrderUrl() { 129 return this.orderUrl; 130 } 131 132 @java.lang.SuppressWarnings("all") 133 @lombok.Generated 134 public void setOrderUrl(final String orderUrl) { 135 this.orderUrl = orderUrl; 136 } 137 138 @java.lang.SuppressWarnings("all") 139 @lombok.Generated 140 public Long getTimestamp() { 141 return this.timestamp; 142 } 143 144 @java.lang.SuppressWarnings("all") 145 @lombok.Generated 146 public void setTimestamp(final Long timestamp) { 147 this.timestamp = timestamp; 148 } 149 150 @java.lang.SuppressWarnings("all") 151 @lombok.Generated 152 public ReceiptAddress getAddress() { 153 return this.address; 154 } 155 156 @java.lang.SuppressWarnings("all") 157 @lombok.Generated 158 public void setAddress(final ReceiptAddress address) { 159 this.address = address; 160 } 161 162 @java.lang.SuppressWarnings("all") 163 @lombok.Generated 164 public ReceiptSummary getSummary() { 165 return this.summary; 166 } 167}