com.salesforce.einsteinbot.sdk.model.ChoicesResponseMessage Maven / Gradle / Ivy
/*
* Einstein Bots API (BETA)
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.salesforce.einsteinbot.sdk.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.salesforce.einsteinbot.sdk.model.ChoicesResponseMessageChoices;
import com.salesforce.einsteinbot.sdk.model.Schedule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Choices message response to be sent from the bot to the client
*/
@ApiModel(description = "Choices message response to be sent from the bot to the client")
@JsonPropertyOrder({
ChoicesResponseMessage.JSON_PROPERTY_TYPE,
ChoicesResponseMessage.JSON_PROPERTY_ID,
ChoicesResponseMessage.JSON_PROPERTY_CHOICES,
ChoicesResponseMessage.JSON_PROPERTY_WIDGET,
ChoicesResponseMessage.JSON_PROPERTY_SCHEDULE
})
@JsonTypeName("ChoicesResponseMessage")
@javax.annotation.Generated(value = "com.salesforce.einsteinbot.openapi.codegen.EinsteinBotCodeGenerator", date = "2022-03-24T00:55:11.933462Z[Etc/UTC]")
public class ChoicesResponseMessage implements AnyResponseMessage {
/**
* Message type
*/
public enum TypeEnum {
CHOICES("choices");
private String value;
TypeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_TYPE = "type";
private TypeEnum type;
public static final String JSON_PROPERTY_ID = "id";
private String id;
public static final String JSON_PROPERTY_CHOICES = "choices";
private List choices = new ArrayList<>();
/**
* Preferred widget type
*/
public enum WidgetEnum {
BUTTONS("buttons"),
MENU("menu");
private String value;
WidgetEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static WidgetEnum fromValue(String value) {
for (WidgetEnum b : WidgetEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_WIDGET = "widget";
private WidgetEnum widget;
public static final String JSON_PROPERTY_SCHEDULE = "schedule";
private Schedule schedule;
public ChoicesResponseMessage() {
}
public ChoicesResponseMessage type(TypeEnum type) {
this.type = type;
return this;
}
/**
* Message type
* @return type
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "choices", required = true, value = "Message type")
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public TypeEnum getType() {
return type;
}
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setType(TypeEnum type) {
this.type = type;
}
public ChoicesResponseMessage id(String id) {
this.id = id;
return this;
}
/**
* UUID that references this message
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "a133c185-73a7-4adf-b6d9-b7fd62babb4e", required = true, value = "UUID that references this message")
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setId(String id) {
this.id = id;
}
public ChoicesResponseMessage choices(List choices) {
this.choices = choices;
return this;
}
public ChoicesResponseMessage addChoicesItem(ChoicesResponseMessageChoices choicesItem) {
this.choices.add(choicesItem);
return this;
}
/**
* Available choices
* @return choices
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Available choices")
@JsonProperty(JSON_PROPERTY_CHOICES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getChoices() {
return choices;
}
@JsonProperty(JSON_PROPERTY_CHOICES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setChoices(List choices) {
this.choices = choices;
}
public ChoicesResponseMessage widget(WidgetEnum widget) {
this.widget = widget;
return this;
}
/**
* Preferred widget type
* @return widget
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "buttons", required = true, value = "Preferred widget type")
@JsonProperty(JSON_PROPERTY_WIDGET)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public WidgetEnum getWidget() {
return widget;
}
@JsonProperty(JSON_PROPERTY_WIDGET)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setWidget(WidgetEnum widget) {
this.widget = widget;
}
public ChoicesResponseMessage schedule(Schedule schedule) {
this.schedule = schedule;
return this;
}
/**
* Get schedule
* @return schedule
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_SCHEDULE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Schedule getSchedule() {
return schedule;
}
@JsonProperty(JSON_PROPERTY_SCHEDULE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSchedule(Schedule schedule) {
this.schedule = schedule;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ChoicesResponseMessage choicesResponseMessage = (ChoicesResponseMessage) o;
return Objects.equals(this.type, choicesResponseMessage.type) &&
Objects.equals(this.id, choicesResponseMessage.id) &&
Objects.equals(this.choices, choicesResponseMessage.choices) &&
Objects.equals(this.widget, choicesResponseMessage.widget) &&
Objects.equals(this.schedule, choicesResponseMessage.schedule);
}
@Override
public int hashCode() {
return Objects.hash(type, id, choices, widget, schedule);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ChoicesResponseMessage {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" choices: ").append(toIndentedString(choices)).append("\n");
sb.append(" widget: ").append(toIndentedString(widget)).append("\n");
sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy