com.textmagic.sdk.model.MessageSession Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of textmagic-java-sdk Show documentation
Show all versions of textmagic-java-sdk Show documentation
Java wrapper library for Textmagic services
/*
* TextMagic API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.textmagic.sdk.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
/**
* MessageSession
*/
public class MessageSession {
@SerializedName("id")
private Integer id = null;
@SerializedName("startTime")
private String startTime = null;
@SerializedName("text")
private String text = null;
@SerializedName("source")
private String source = null;
@SerializedName("referenceId")
private String referenceId = null;
@SerializedName("price")
private BigDecimal price = null;
@SerializedName("numbersCount")
private Integer numbersCount = null;
/**
* Destination type of a Message Session: * **t** – text SMS; * **s** – text-to-speech; * **v** – voice broadcast.
*/
@JsonAdapter(DestinationEnum.Adapter.class)
public enum DestinationEnum {
T("t"),
S("s"),
V("v");
private String value;
DestinationEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static DestinationEnum fromValue(String text) {
for (DestinationEnum b : DestinationEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final DestinationEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public DestinationEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return DestinationEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("destination")
private DestinationEnum destination = null;
public MessageSession id(Integer id) {
this.id = id;
return this;
}
/**
* Session ID.
* @return id
**/
@ApiModelProperty(example = "4991", required = true, value = "Session ID.")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public MessageSession startTime(String startTime) {
this.startTime = startTime;
return this;
}
/**
* Session creation time.
* @return startTime
**/
@ApiModelProperty(example = "2015-06-19T09:48:24+0000", required = true, value = "Session creation time.")
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public MessageSession text(String text) {
this.text = text;
return this;
}
/**
* Session text. If a template was used for the session text (see [Messages: Send](https://docs.textmagic.com/#tag/Outbound-Messages) for details), it may contain template tags.
* @return text
**/
@ApiModelProperty(example = "Hello {First name}!", required = true, value = "Session text. If a template was used for the session text (see [Messages: Send](https://docs.textmagic.com/#tag/Outbound-Messages) for details), it may contain template tags. ")
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public MessageSession source(String source) {
this.source = source;
return this;
}
/**
* * **O** – for TextMagic Online; * **A** – for API; * **M** – for TextMagic Messenger; * **E** – for [Email to SMS](https://docs.textmagic.com/#tag/Send-Email-to-SMS); * **X** – for [Distribution Lists](https://docs.textmagic.com/#tag/Distribution-Lists).
* @return source
**/
@ApiModelProperty(example = "O", required = true, value = "* **O** – for TextMagic Online; * **A** – for API; * **M** – for TextMagic Messenger; * **E** – for [Email to SMS](https://docs.textmagic.com/#tag/Send-Email-to-SMS); * **X** – for [Distribution Lists](https://docs.textmagic.com/#tag/Distribution-Lists). ")
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public MessageSession referenceId(String referenceId) {
this.referenceId = referenceId;
return this;
}
/**
* Custom reference ID (see [Messages: Send](https://docs.textmagic.com/#tag/Send-Email-to-SMS) for details).
* @return referenceId
**/
@ApiModelProperty(example = "my_reference_id_4991", required = true, value = "Custom reference ID (see [Messages: Send](https://docs.textmagic.com/#tag/Send-Email-to-SMS) for details). ")
public String getReferenceId() {
return referenceId;
}
public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}
public MessageSession price(BigDecimal price) {
this.price = price;
return this;
}
/**
* Session cost (in account currency).
* @return price
**/
@ApiModelProperty(example = "3.45", required = true, value = "Session cost (in account currency).")
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public MessageSession numbersCount(Integer numbersCount) {
this.numbersCount = numbersCount;
return this;
}
/**
* Session recipient count.
* @return numbersCount
**/
@ApiModelProperty(example = "18", required = true, value = "Session recipient count.")
public Integer getNumbersCount() {
return numbersCount;
}
public void setNumbersCount(Integer numbersCount) {
this.numbersCount = numbersCount;
}
public MessageSession destination(DestinationEnum destination) {
this.destination = destination;
return this;
}
/**
* Destination type of a Message Session: * **t** – text SMS; * **s** – text-to-speech; * **v** – voice broadcast.
* @return destination
**/
@ApiModelProperty(example = "t", required = true, value = "Destination type of a Message Session: * **t** – text SMS; * **s** – text-to-speech; * **v** – voice broadcast. ")
public DestinationEnum getDestination() {
return destination;
}
public void setDestination(DestinationEnum destination) {
this.destination = destination;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MessageSession messageSession = (MessageSession) o;
return Objects.equals(this.id, messageSession.id) &&
Objects.equals(this.startTime, messageSession.startTime) &&
Objects.equals(this.text, messageSession.text) &&
Objects.equals(this.source, messageSession.source) &&
Objects.equals(this.referenceId, messageSession.referenceId) &&
Objects.equals(this.price, messageSession.price) &&
Objects.equals(this.numbersCount, messageSession.numbersCount) &&
Objects.equals(this.destination, messageSession.destination);
}
@Override
public int hashCode() {
return Objects.hash(id, startTime, text, source, referenceId, price, numbersCount, destination);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MessageSession {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n");
sb.append(" text: ").append(toIndentedString(text)).append("\n");
sb.append(" source: ").append(toIndentedString(source)).append("\n");
sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n");
sb.append(" price: ").append(toIndentedString(price)).append("\n");
sb.append(" numbersCount: ").append(toIndentedString(numbersCount)).append("\n");
sb.append(" destination: ").append(toIndentedString(destination)).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 ");
}
}