001// Generated by delombok at Wed Nov 11 21:20:25 CET 2020
002/*
003 * Copyright (c) 2010-2020 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   * Title for the CTA that was clicked on. This is sent to all apps subscribed to the page.
034   *
035   * For apps other than the original CTA sender, the postback event will be delivered via the
036   * <a href="https://developers.facebook.com/docs/messenger-platform/webhook-reference/standby-channel"
037   * target="_self">standby channel</a>.
038   */
039  @Facebook
040  private String title;
041  /**
042   * payload parameter that was defined with the button
043   */
044  @Facebook
045  private String payload;
046  /**
047   * Comes only with Get Started postback and if an optional ref param was passed from the entry point, such as m.me
048   * link.
049   */
050  @Facebook
051  private PostbackReferral referral;
052
053  @java.lang.Override
054  @java.lang.SuppressWarnings("all")
055  public java.lang.String toString() {
056    return "PostbackItem(title=" + this.getTitle() + ", payload=" + this.getPayload() + ", referral=" + this.getReferral() + ")";
057  }
058
059  /**
060   * Title for the CTA that was clicked on. This is sent to all apps subscribed to the page.
061   *
062   * For apps other than the original CTA sender, the postback event will be delivered via the
063   * <a href="https://developers.facebook.com/docs/messenger-platform/webhook-reference/standby-channel"
064   * target="_self">standby channel</a>.
065   */
066  @java.lang.SuppressWarnings("all")
067  public String getTitle() {
068    return this.title;
069  }
070
071  /**
072   * Title for the CTA that was clicked on. This is sent to all apps subscribed to the page.
073   *
074   * For apps other than the original CTA sender, the postback event will be delivered via the
075   * <a href="https://developers.facebook.com/docs/messenger-platform/webhook-reference/standby-channel"
076   * target="_self">standby channel</a>.
077   */
078  @java.lang.SuppressWarnings("all")
079  public void setTitle(final String title) {
080    this.title = title;
081  }
082
083  /**
084   * payload parameter that was defined with the button
085   */
086  @java.lang.SuppressWarnings("all")
087  public String getPayload() {
088    return this.payload;
089  }
090
091  /**
092   * payload parameter that was defined with the button
093   */
094  @java.lang.SuppressWarnings("all")
095  public void setPayload(final String payload) {
096    this.payload = payload;
097  }
098
099  /**
100   * Comes only with Get Started postback and if an optional ref param was passed from the entry point, such as m.me
101   * link.
102   */
103  @java.lang.SuppressWarnings("all")
104  public PostbackReferral getReferral() {
105    return this.referral;
106  }
107
108  /**
109   * Comes only with Get Started postback and if an optional ref param was passed from the entry point, such as m.me
110   * link.
111   */
112  @java.lang.SuppressWarnings("all")
113  public void setReferral(final PostbackReferral referral) {
114    this.referral = referral;
115  }
116}