com.mailslurp.models.WaitForSmsConditions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mailslurp-client-java Show documentation
Show all versions of mailslurp-client-java Show documentation
Official MailSlurp email API - create real inboxes then send and receive emails and attachments from tests and code.
The newest version!
/*
* MailSlurp API
* MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
*
* The version of the OpenAPI document: 6.5.2
* 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 com.mailslurp.models;
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 com.mailslurp.models.SmsMatchOption;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* Conditions to apply to emails that you are waiting for
*/
@ApiModel(description = "Conditions to apply to emails that you are waiting for")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-03T06:03:24.997Z[GMT]")
public class WaitForSmsConditions {
public static final String SERIALIZED_NAME_PHONE_NUMBER_ID = "phoneNumberId";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER_ID)
private UUID phoneNumberId;
public static final String SERIALIZED_NAME_LIMIT = "limit";
@SerializedName(SERIALIZED_NAME_LIMIT)
private Integer limit;
public static final String SERIALIZED_NAME_COUNT = "count";
@SerializedName(SERIALIZED_NAME_COUNT)
private Long count;
public static final String SERIALIZED_NAME_DELAY_TIMEOUT = "delayTimeout";
@SerializedName(SERIALIZED_NAME_DELAY_TIMEOUT)
private Long delayTimeout;
public static final String SERIALIZED_NAME_TIMEOUT = "timeout";
@SerializedName(SERIALIZED_NAME_TIMEOUT)
private Long timeout;
public static final String SERIALIZED_NAME_UNREAD_ONLY = "unreadOnly";
@SerializedName(SERIALIZED_NAME_UNREAD_ONLY)
private Boolean unreadOnly;
/**
* How result size should be compared with the expected size. Exactly or at-least matching result?
*/
@JsonAdapter(CountTypeEnum.Adapter.class)
public enum CountTypeEnum {
EXACTLY("EXACTLY"),
ATLEAST("ATLEAST");
private String value;
CountTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static CountTypeEnum fromValue(String value) {
for (CountTypeEnum b : CountTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final CountTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public CountTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return CountTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_COUNT_TYPE = "countType";
@SerializedName(SERIALIZED_NAME_COUNT_TYPE)
private CountTypeEnum countType;
public static final String SERIALIZED_NAME_MATCHES = "matches";
@SerializedName(SERIALIZED_NAME_MATCHES)
private List matches = null;
/**
* Direction to sort matching SMSs by created time
*/
@JsonAdapter(SortDirectionEnum.Adapter.class)
public enum SortDirectionEnum {
ASC("ASC"),
DESC("DESC");
private String value;
SortDirectionEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SortDirectionEnum fromValue(String value) {
for (SortDirectionEnum b : SortDirectionEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final SortDirectionEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SortDirectionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SortDirectionEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SORT_DIRECTION = "sortDirection";
@SerializedName(SERIALIZED_NAME_SORT_DIRECTION)
private SortDirectionEnum sortDirection;
public static final String SERIALIZED_NAME_SINCE = "since";
@SerializedName(SERIALIZED_NAME_SINCE)
private OffsetDateTime since;
public static final String SERIALIZED_NAME_BEFORE = "before";
@SerializedName(SERIALIZED_NAME_BEFORE)
private OffsetDateTime before;
public WaitForSmsConditions phoneNumberId(UUID phoneNumberId) {
this.phoneNumberId = phoneNumberId;
return this;
}
/**
* ID of phone number to search within and apply conditions to. Essentially filtering the SMS found to give a count.
* @return phoneNumberId
**/
@ApiModelProperty(required = true, value = "ID of phone number to search within and apply conditions to. Essentially filtering the SMS found to give a count.")
public UUID getPhoneNumberId() {
return phoneNumberId;
}
public void setPhoneNumberId(UUID phoneNumberId) {
this.phoneNumberId = phoneNumberId;
}
public WaitForSmsConditions limit(Integer limit) {
this.limit = limit;
return this;
}
/**
* Limit results
* @return limit
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Limit results")
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public WaitForSmsConditions count(Long count) {
this.count = count;
return this;
}
/**
* Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation.
* @return count
**/
@ApiModelProperty(required = true, value = "Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation.")
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public WaitForSmsConditions delayTimeout(Long delayTimeout) {
this.delayTimeout = delayTimeout;
return this;
}
/**
* Max time in milliseconds to wait between retries if a `timeout` is specified.
* @return delayTimeout
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Max time in milliseconds to wait between retries if a `timeout` is specified.")
public Long getDelayTimeout() {
return delayTimeout;
}
public void setDelayTimeout(Long delayTimeout) {
this.delayTimeout = delayTimeout;
}
public WaitForSmsConditions timeout(Long timeout) {
this.timeout = timeout;
return this;
}
/**
* Max time in milliseconds to retry the `waitFor` operation until conditions are met.
* @return timeout
**/
@ApiModelProperty(required = true, value = "Max time in milliseconds to retry the `waitFor` operation until conditions are met.")
public Long getTimeout() {
return timeout;
}
public void setTimeout(Long timeout) {
this.timeout = timeout;
}
public WaitForSmsConditions unreadOnly(Boolean unreadOnly) {
this.unreadOnly = unreadOnly;
return this;
}
/**
* Apply conditions only to **unread** SMS. All SMS messages begin with `read=false`. An SMS is marked `read=true` when an `SMS` has been returned to the user at least once. For example you have called `getSms` or `waitForSms` etc., or you have viewed the SMS in the dashboard.
* @return unreadOnly
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Apply conditions only to **unread** SMS. All SMS messages begin with `read=false`. An SMS is marked `read=true` when an `SMS` has been returned to the user at least once. For example you have called `getSms` or `waitForSms` etc., or you have viewed the SMS in the dashboard.")
public Boolean getUnreadOnly() {
return unreadOnly;
}
public void setUnreadOnly(Boolean unreadOnly) {
this.unreadOnly = unreadOnly;
}
public WaitForSmsConditions countType(CountTypeEnum countType) {
this.countType = countType;
return this;
}
/**
* How result size should be compared with the expected size. Exactly or at-least matching result?
* @return countType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "How result size should be compared with the expected size. Exactly or at-least matching result?")
public CountTypeEnum getCountType() {
return countType;
}
public void setCountType(CountTypeEnum countType) {
this.countType = countType;
}
public WaitForSmsConditions matches(List matches) {
this.matches = matches;
return this;
}
public WaitForSmsConditions addMatchesItem(SmsMatchOption matchesItem) {
if (this.matches == null) {
this.matches = new ArrayList<>();
}
this.matches.add(matchesItem);
return this;
}
/**
* Conditions that should be matched for an SMS to qualify for results. Each condition will be applied in order to each SMS within a phone number to filter a result list of matching SMSs you are waiting for.
* @return matches
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Conditions that should be matched for an SMS to qualify for results. Each condition will be applied in order to each SMS within a phone number to filter a result list of matching SMSs you are waiting for.")
public List getMatches() {
return matches;
}
public void setMatches(List matches) {
this.matches = matches;
}
public WaitForSmsConditions sortDirection(SortDirectionEnum sortDirection) {
this.sortDirection = sortDirection;
return this;
}
/**
* Direction to sort matching SMSs by created time
* @return sortDirection
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Direction to sort matching SMSs by created time")
public SortDirectionEnum getSortDirection() {
return sortDirection;
}
public void setSortDirection(SortDirectionEnum sortDirection) {
this.sortDirection = sortDirection;
}
public WaitForSmsConditions since(OffsetDateTime since) {
this.since = since;
return this;
}
/**
* ISO Date Time earliest time of SMS to consider. Filter for matching SMSs that were received after this date
* @return since
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ISO Date Time earliest time of SMS to consider. Filter for matching SMSs that were received after this date")
public OffsetDateTime getSince() {
return since;
}
public void setSince(OffsetDateTime since) {
this.since = since;
}
public WaitForSmsConditions before(OffsetDateTime before) {
this.before = before;
return this;
}
/**
* ISO Date Time latest time of SMS to consider. Filter for matching SMSs that were received before this date
* @return before
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ISO Date Time latest time of SMS to consider. Filter for matching SMSs that were received before this date")
public OffsetDateTime getBefore() {
return before;
}
public void setBefore(OffsetDateTime before) {
this.before = before;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WaitForSmsConditions waitForSmsConditions = (WaitForSmsConditions) o;
return Objects.equals(this.phoneNumberId, waitForSmsConditions.phoneNumberId) &&
Objects.equals(this.limit, waitForSmsConditions.limit) &&
Objects.equals(this.count, waitForSmsConditions.count) &&
Objects.equals(this.delayTimeout, waitForSmsConditions.delayTimeout) &&
Objects.equals(this.timeout, waitForSmsConditions.timeout) &&
Objects.equals(this.unreadOnly, waitForSmsConditions.unreadOnly) &&
Objects.equals(this.countType, waitForSmsConditions.countType) &&
Objects.equals(this.matches, waitForSmsConditions.matches) &&
Objects.equals(this.sortDirection, waitForSmsConditions.sortDirection) &&
Objects.equals(this.since, waitForSmsConditions.since) &&
Objects.equals(this.before, waitForSmsConditions.before);
}
@Override
public int hashCode() {
return Objects.hash(phoneNumberId, limit, count, delayTimeout, timeout, unreadOnly, countType, matches, sortDirection, since, before);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WaitForSmsConditions {\n");
sb.append(" phoneNumberId: ").append(toIndentedString(phoneNumberId)).append("\n");
sb.append(" limit: ").append(toIndentedString(limit)).append("\n");
sb.append(" count: ").append(toIndentedString(count)).append("\n");
sb.append(" delayTimeout: ").append(toIndentedString(delayTimeout)).append("\n");
sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n");
sb.append(" unreadOnly: ").append(toIndentedString(unreadOnly)).append("\n");
sb.append(" countType: ").append(toIndentedString(countType)).append("\n");
sb.append(" matches: ").append(toIndentedString(matches)).append("\n");
sb.append(" sortDirection: ").append(toIndentedString(sortDirection)).append("\n");
sb.append(" since: ").append(toIndentedString(since)).append("\n");
sb.append(" before: ").append(toIndentedString(before)).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 ");
}
}