
com.infobip.model.WhatsAppWebhookInboundTextContent Maven / Gradle / Ivy
/*
* This class is auto generated from the Infobip OpenAPI specification
* through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR),
* powered by the OpenAPI Generator (https://openapi-generator.tech).
*
* Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide
* or contact us @ [email protected].
*/
package com.infobip.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* Represents WhatsAppWebhookInboundTextContent model.
*/
public class WhatsAppWebhookInboundTextContent extends WhatsAppWebhookInboundContent {
private String text;
private WhatsAppContext context;
private WhatsAppReferral referral;
/**
* Constructs a new {@link WhatsAppWebhookInboundTextContent} instance.
*/
public WhatsAppWebhookInboundTextContent() {
super("TEXT");
}
/**
* Sets text.
*
* Field description:
* Content of the end user's message.
*
* The field is required.
*
* @param text
* @return This {@link WhatsAppWebhookInboundTextContent instance}.
*/
public WhatsAppWebhookInboundTextContent text(String text) {
this.text = text;
return this;
}
/**
* Returns text.
*
* Field description:
* Content of the end user's message.
*
* The field is required.
*
* @return text
*/
@JsonProperty("text")
public String getText() {
return text;
}
/**
* Sets text.
*
* Field description:
* Content of the end user's message.
*
* The field is required.
*
* @param text
*/
@JsonProperty("text")
public void setText(String text) {
this.text = text;
}
/**
* Sets context.
*
* @param context
* @return This {@link WhatsAppWebhookInboundTextContent instance}.
*/
public WhatsAppWebhookInboundTextContent context(WhatsAppContext context) {
this.context = context;
return this;
}
/**
* Returns context.
*
* @return context
*/
@JsonProperty("context")
public WhatsAppContext getContext() {
return context;
}
/**
* Sets context.
*
* @param context
*/
@JsonProperty("context")
public void setContext(WhatsAppContext context) {
this.context = context;
}
/**
* Sets referral.
*
* @param referral
* @return This {@link WhatsAppWebhookInboundTextContent instance}.
*/
public WhatsAppWebhookInboundTextContent referral(WhatsAppReferral referral) {
this.referral = referral;
return this;
}
/**
* Returns referral.
*
* @return referral
*/
@JsonProperty("referral")
public WhatsAppReferral getReferral() {
return referral;
}
/**
* Sets referral.
*
* @param referral
*/
@JsonProperty("referral")
public void setReferral(WhatsAppReferral referral) {
this.referral = referral;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WhatsAppWebhookInboundTextContent whatsAppWebhookInboundTextContent = (WhatsAppWebhookInboundTextContent) o;
return Objects.equals(this.text, whatsAppWebhookInboundTextContent.text)
&& Objects.equals(this.context, whatsAppWebhookInboundTextContent.context)
&& Objects.equals(this.referral, whatsAppWebhookInboundTextContent.referral)
&& super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(text, context, referral, super.hashCode());
}
@Override
public String toString() {
String newLine = System.lineSeparator();
return new StringBuilder()
.append("class WhatsAppWebhookInboundTextContent {")
.append(newLine)
.append(" ")
.append(toIndentedString(super.toString()))
.append(newLine)
.append(" text: ")
.append(toIndentedString(text))
.append(newLine)
.append(" context: ")
.append(toIndentedString(context))
.append(newLine)
.append(" referral: ")
.append(toIndentedString(referral))
.append(newLine)
.append("}")
.toString();
}
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
String lineSeparator = System.lineSeparator();
String lineSeparatorFollowedByIndentation = lineSeparator + " ";
return o.toString().replace(lineSeparator, lineSeparatorFollowedByIndentation);
}
}