001// Generated by delombok at Wed Jan 31 21:27:42 UTC 2024
002/*
003 * Copyright (c) 2010-2024 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.webhook.messaging;
024
025import com.restfb.Facebook;
026
027/**
028 * Represents a receiving postback object as defined here:
029 * https://developers.facebook.com/docs/messenger-platform/webhook-reference/postback
030 */
031public class PostbackItem implements InnerMessagingItem {
032  /**
033   * Message ID
034   */
035  @Facebook
036  private String mid;
037  /**
038   * Title for the CTA that was clicked on. This is sent to all apps subscribed to the page.
039   *
040   * For apps other than the original CTA sender, the postback event will be delivered via the
041   * <a href="https://developers.facebook.com/docs/messenger-platform/webhook-reference/standby-channel"
042   * target="_self">standby channel</a>.
043   */
044  @Facebook
045  private String title;
046  /**
047   * payload parameter that was defined with the button
048   */
049  @Facebook
050  private String payload;
051  /**
052   * Comes only with Get Started postback and if an optional ref param was passed from the entry point, such as m.me
053   * link.
054   */
055  @Facebook
056  private PostbackReferral referral;
057
058  @java.lang.Override
059  @java.lang.SuppressWarnings("all")
060  public java.lang.String toString() {
061    return "PostbackItem(mid=" + this.getMid() + ", title=" + this.getTitle() + ", payload=" + this.getPayload() + ", referral=" + this.getReferral() + ")";
062  }
063
064  /**
065   * Message ID
066   */
067  @java.lang.SuppressWarnings("all")
068  public String getMid() {
069    return this.mid;
070  }
071
072  /**
073   * Message ID
074   */
075  @java.lang.SuppressWarnings("all")
076  public void setMid(final String mid) {
077    this.mid = mid;
078  }
079
080  /**
081   * Title for the CTA that was clicked on. This is sent to all apps subscribed to the page.
082   *
083   * For apps other than the original CTA sender, the postback event will be delivered via the
084   * <a href="https://developers.facebook.com/docs/messenger-platform/webhook-reference/standby-channel"
085   * target="_self">standby channel</a>.
086   */
087  @java.lang.SuppressWarnings("all")
088  public String getTitle() {
089    return this.title;
090  }
091
092  /**
093   * Title for the CTA that was clicked on. This is sent to all apps subscribed to the page.
094   *
095   * For apps other than the original CTA sender, the postback event will be delivered via the
096   * <a href="https://developers.facebook.com/docs/messenger-platform/webhook-reference/standby-channel"
097   * target="_self">standby channel</a>.
098   */
099  @java.lang.SuppressWarnings("all")
100  public void setTitle(final String title) {
101    this.title = title;
102  }
103
104  /**
105   * payload parameter that was defined with the button
106   */
107  @java.lang.SuppressWarnings("all")
108  public String getPayload() {
109    return this.payload;
110  }
111
112  /**
113   * payload parameter that was defined with the button
114   */
115  @java.lang.SuppressWarnings("all")
116  public void setPayload(final String payload) {
117    this.payload = payload;
118  }
119
120  /**
121   * Comes only with Get Started postback and if an optional ref param was passed from the entry point, such as m.me
122   * link.
123   */
124  @java.lang.SuppressWarnings("all")
125  public PostbackReferral getReferral() {
126    return this.referral;
127  }
128
129  /**
130   * Comes only with Get Started postback and if an optional ref param was passed from the entry point, such as m.me
131   * link.
132   */
133  @java.lang.SuppressWarnings("all")
134  public void setReferral(final PostbackReferral referral) {
135    this.referral = referral;
136  }
137}