io.smooch.v2.client.model.Content Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
io.smooch - api - 6.0.0-alpha.7
/*
* Sunshine Conversations API
* # # Introduction Welcome to the Sunshine Conversations API. The API allows you to craft entirely unique messaging experiences for your app and website as well as talk to any backend or external service. The Sunshine Conversations API is designed according to REST principles. The API accepts JSON in request bodies and requires that the content-type: application/json header be specified for all such requests. The API will always respond with an object. Depending on context, resources may be returned as single objects or as arrays of objects, nested within the response object. In some cases, the API will also facilitate cross-origin resource sharing so that it can be called from a web application. ## API pagination and records limits Some APIs can be paginated by providing the `offset` query string parameter. The `offset` is the number of initial records to skip before picking records to return (default 0). The `limit` query string can also be provided to change the number of records to return (maximum 100, default 25). All paginated endpoints will eventually support cursor pagination and `offset` based pagination support will be dropped. ### Cursor Pagination Some APIs are paginated through cursor pagination. Rather than providing an `offset`, a `page[after]` or `page[before]` query string parameter may be provided. `page[after]` and `page[before]` are cursors pointing to a record id. The `page[after]` cursor indicates that only records **subsequent** to it should be returned. The `page[before]` cursor indicates that only records **preceding** it should be returned. **Only one** of `page[after]` or `page[before]` may be provided in a query, not both. In cursor pagination, the equivalent to the `limit` query string is the `page[size]` query string parameter. ## Regions Sunshine Conversations is available in the following regions. Each Sunshine Conversations region has its own API host. | Region | Host | | -------------- | -------------------------- | | United States | https://api.smooch.io | | European Union | https://api.eu-1.smooch.io | For more information on regions, visit [the guide](/guide/regions/).
*
* The version of the OpenAPI document: 6.0.0-alpha.1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.smooch.v2.client.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.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
import io.smooch.v2.client.model.ActionSubset;
import io.smooch.v2.client.model.CarouselMessage;
import io.smooch.v2.client.model.CarouselMessageDisplaySettings;
import io.smooch.v2.client.model.Field;
import io.smooch.v2.client.model.FileMessage;
import io.smooch.v2.client.model.FormMessage;
import io.smooch.v2.client.model.FormResponseMessage;
import io.smooch.v2.client.model.ImageMessage;
import io.smooch.v2.client.model.Item;
import io.smooch.v2.client.model.ListMessage;
import io.smooch.v2.client.model.LocationMessage;
import io.smooch.v2.client.model.LocationMessageCoordinates;
import io.smooch.v2.client.model.LocationMessageLocation;
import io.smooch.v2.client.model.QuotedMessage;
import io.smooch.v2.client.model.TextMessage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Content
*/
@JsonPropertyOrder({
Content.JSON_PROPERTY_TYPE,
Content.JSON_PROPERTY_TEXT,
Content.JSON_PROPERTY_ACTIONS,
Content.JSON_PROPERTY_ITEMS,
Content.JSON_PROPERTY_DISPLAY_SETTINGS,
Content.JSON_PROPERTY_MEDIA_URL,
Content.JSON_PROPERTY_BLOCK_CHAT_INPUT,
Content.JSON_PROPERTY_FIELDS,
Content.JSON_PROPERTY_QUOTED_MESSAGE,
Content.JSON_PROPERTY_COORDINATES,
Content.JSON_PROPERTY_LOCATION
})
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = CarouselMessage.class, name = "carouselMessage"),
@JsonSubTypes.Type(value = FileMessage.class, name = "fileMessage"),
@JsonSubTypes.Type(value = FormMessage.class, name = "formMessage"),
@JsonSubTypes.Type(value = FormResponseMessage.class, name = "formResponseMessage"),
@JsonSubTypes.Type(value = ImageMessage.class, name = "imageMessage"),
@JsonSubTypes.Type(value = ListMessage.class, name = "listMessage"),
@JsonSubTypes.Type(value = LocationMessage.class, name = "locationMessage"),
@JsonSubTypes.Type(value = TextMessage.class, name = "textMessage"),
})
public class Content {
public static final String JSON_PROPERTY_TYPE = "type";
protected String type;
public static final String JSON_PROPERTY_TEXT = "text";
private String text;
public static final String JSON_PROPERTY_ACTIONS = "actions";
private List actions = null;
public static final String JSON_PROPERTY_ITEMS = "items";
private List- items = new ArrayList
- ();
public static final String JSON_PROPERTY_DISPLAY_SETTINGS = "displaySettings";
private CarouselMessageDisplaySettings displaySettings;
public static final String JSON_PROPERTY_MEDIA_URL = "mediaUrl";
private URI mediaUrl;
public static final String JSON_PROPERTY_BLOCK_CHAT_INPUT = "blockChatInput";
private Boolean blockChatInput;
public static final String JSON_PROPERTY_FIELDS = "fields";
private List
fields = new ArrayList();
public static final String JSON_PROPERTY_QUOTED_MESSAGE = "quotedMessage";
private QuotedMessage quotedMessage = null;
public static final String JSON_PROPERTY_COORDINATES = "coordinates";
private LocationMessageCoordinates coordinates;
public static final String JSON_PROPERTY_LOCATION = "location";
private LocationMessageLocation location;
public Content type(String type) {
this.type = type;
return this;
}
/**
* The type of message.
* @return type
**/
@ApiModelProperty(required = true, value = "The type of message.")
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Content text(String text) {
this.text = text;
return this;
}
/**
* The text content of the message. Optional only if actions are provided.
* @return text
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The text content of the message. Optional only if actions are provided.")
@JsonProperty(JSON_PROPERTY_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Content actions(List actions) {
this.actions = actions;
return this;
}
public Content addActionsItem(ActionSubset actionsItem) {
if (this.actions == null) {
this.actions = new ArrayList();
}
this.actions.add(actionsItem);
return this;
}
/**
* An array of objects representing the actions associated with the message. The array length is limited by the third party channel.
* @return actions
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "An array of objects representing the actions associated with the message. The array length is limited by the third party channel.")
@JsonProperty(JSON_PROPERTY_ACTIONS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getActions() {
return actions;
}
public void setActions(List actions) {
this.actions = actions;
}
public Content items(List- items) {
this.items = items;
return this;
}
public Content addItemsItem(Item itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* An array of objects representing the items associated with the message. Only present in carousel and list type messages.
* @return items
**/
@ApiModelProperty(required = true, value = "An array of objects representing the items associated with the message. Only present in carousel and list type messages.")
@JsonProperty(JSON_PROPERTY_ITEMS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List
- getItems() {
return items;
}
public void setItems(List
- items) {
this.items = items;
}
public Content displaySettings(CarouselMessageDisplaySettings displaySettings) {
this.displaySettings = displaySettings;
return this;
}
/**
* Get displaySettings
* @return displaySettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_DISPLAY_SETTINGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CarouselMessageDisplaySettings getDisplaySettings() {
return displaySettings;
}
public void setDisplaySettings(CarouselMessageDisplaySettings displaySettings) {
this.displaySettings = displaySettings;
}
public Content mediaUrl(URI mediaUrl) {
this.mediaUrl = mediaUrl;
return this;
}
/**
* The URL for media, such as an image, attached to the message.
* @return mediaUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The URL for media, such as an image, attached to the message.")
@JsonProperty(JSON_PROPERTY_MEDIA_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public URI getMediaUrl() {
return mediaUrl;
}
public void setMediaUrl(URI mediaUrl) {
this.mediaUrl = mediaUrl;
}
public Content blockChatInput(Boolean blockChatInput) {
this.blockChatInput = blockChatInput;
return this;
}
/**
* true if the message should block the chat input on Web Messenger. form message only.
* @return blockChatInput
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "true if the message should block the chat input on Web Messenger. form message only.")
@JsonProperty(JSON_PROPERTY_BLOCK_CHAT_INPUT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getBlockChatInput() {
return blockChatInput;
}
public void setBlockChatInput(Boolean blockChatInput) {
this.blockChatInput = blockChatInput;
}
public Content fields(List
fields) {
this.fields = fields;
return this;
}
public Content addFieldsItem(Field fieldsItem) {
this.fields.add(fieldsItem);
return this;
}
/**
* Array of field objects that contain the submitted fields.
* @return fields
**/
@ApiModelProperty(required = true, value = "Array of field objects that contain the submitted fields.")
@JsonProperty(JSON_PROPERTY_FIELDS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getFields() {
return fields;
}
public void setFields(List fields) {
this.fields = fields;
}
public Content quotedMessage(QuotedMessage quotedMessage) {
this.quotedMessage = quotedMessage;
return this;
}
/**
* Object indicating the form message that is being responded to.
* @return quotedMessage
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Object indicating the form message that is being responded to.")
@JsonProperty(JSON_PROPERTY_QUOTED_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public QuotedMessage getQuotedMessage() {
return quotedMessage;
}
public void setQuotedMessage(QuotedMessage quotedMessage) {
this.quotedMessage = quotedMessage;
}
public Content coordinates(LocationMessageCoordinates coordinates) {
this.coordinates = coordinates;
return this;
}
/**
* Get coordinates
* @return coordinates
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_COORDINATES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public LocationMessageCoordinates getCoordinates() {
return coordinates;
}
public void setCoordinates(LocationMessageCoordinates coordinates) {
this.coordinates = coordinates;
}
public Content location(LocationMessageLocation location) {
this.location = location;
return this;
}
/**
* Get location
* @return location
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_LOCATION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public LocationMessageLocation getLocation() {
return location;
}
public void setLocation(LocationMessageLocation location) {
this.location = location;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Content content = (Content) o;
return Objects.equals(this.type, content.type) &&
Objects.equals(this.text, content.text) &&
Objects.equals(this.actions, content.actions) &&
Objects.equals(this.items, content.items) &&
Objects.equals(this.displaySettings, content.displaySettings) &&
Objects.equals(this.mediaUrl, content.mediaUrl) &&
Objects.equals(this.blockChatInput, content.blockChatInput) &&
Objects.equals(this.fields, content.fields) &&
Objects.equals(this.quotedMessage, content.quotedMessage) &&
Objects.equals(this.coordinates, content.coordinates) &&
Objects.equals(this.location, content.location);
}
@Override
public int hashCode() {
return Objects.hash(type, text, actions, items, displaySettings, mediaUrl, blockChatInput, fields, quotedMessage, coordinates, location);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Content {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
sb.append(" actions: ").append(toIndentedString(actions)).append("\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append(" displaySettings: ").append(toIndentedString(displaySettings)).append("\n");
sb.append(" mediaUrl: ").append(toIndentedString(mediaUrl)).append("\n");
sb.append(" blockChatInput: ").append(toIndentedString(blockChatInput)).append("\n");
sb.append(" fields: ").append(toIndentedString(fields)).append("\n");
sb.append(" quotedMessage: ").append(toIndentedString(quotedMessage)).append("\n");
sb.append(" coordinates: ").append(toIndentedString(coordinates)).append("\n");
sb.append(" location: ").append(toIndentedString(location)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}