All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mailslurp.models.SearchEmailsOptions Maven / Gradle / Ivy

Go to download

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 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;

/**
 * SearchEmailsOptions
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-03T06:03:24.997Z[GMT]")
public class SearchEmailsOptions {
  public static final String SERIALIZED_NAME_INBOX_IDS = "inboxIds";
  @SerializedName(SERIALIZED_NAME_INBOX_IDS)
  private List inboxIds = null;

  public static final String SERIALIZED_NAME_PAGE_INDEX = "pageIndex";
  @SerializedName(SERIALIZED_NAME_PAGE_INDEX)
  private Integer pageIndex;

  public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize";
  @SerializedName(SERIALIZED_NAME_PAGE_SIZE)
  private Integer pageSize;

  /**
   * Optional createdAt sort direction ASC or DESC
   */
  @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;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    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_UNREAD_ONLY = "unreadOnly";
  @SerializedName(SERIALIZED_NAME_UNREAD_ONLY)
  private Boolean unreadOnly;

  public static final String SERIALIZED_NAME_SEARCH_FILTER = "searchFilter";
  @SerializedName(SERIALIZED_NAME_SEARCH_FILTER)
  private String searchFilter;

  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 SearchEmailsOptions inboxIds(List inboxIds) {
    
    this.inboxIds = inboxIds;
    return this;
  }

  public SearchEmailsOptions addInboxIdsItem(UUID inboxIdsItem) {
    if (this.inboxIds == null) {
      this.inboxIds = new ArrayList<>();
    }
    this.inboxIds.add(inboxIdsItem);
    return this;
  }

   /**
   * Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
   * @return inboxIds
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.")

  public List getInboxIds() {
    return inboxIds;
  }


  public void setInboxIds(List inboxIds) {
    this.inboxIds = inboxIds;
  }


  public SearchEmailsOptions pageIndex(Integer pageIndex) {
    
    this.pageIndex = pageIndex;
    return this;
  }

   /**
   * Optional page index in email list pagination
   * @return pageIndex
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional page index in email list pagination")

  public Integer getPageIndex() {
    return pageIndex;
  }


  public void setPageIndex(Integer pageIndex) {
    this.pageIndex = pageIndex;
  }


  public SearchEmailsOptions pageSize(Integer pageSize) {
    
    this.pageSize = pageSize;
    return this;
  }

   /**
   * Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results
   * maximum: 100
   * @return pageSize
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results")

  public Integer getPageSize() {
    return pageSize;
  }


  public void setPageSize(Integer pageSize) {
    this.pageSize = pageSize;
  }


  public SearchEmailsOptions sortDirection(SortDirectionEnum sortDirection) {
    
    this.sortDirection = sortDirection;
    return this;
  }

   /**
   * Optional createdAt sort direction ASC or DESC
   * @return sortDirection
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional createdAt sort direction ASC or DESC")

  public SortDirectionEnum getSortDirection() {
    return sortDirection;
  }


  public void setSortDirection(SortDirectionEnum sortDirection) {
    this.sortDirection = sortDirection;
  }


  public SearchEmailsOptions unreadOnly(Boolean unreadOnly) {
    
    this.unreadOnly = unreadOnly;
    return this;
  }

   /**
   * Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly
   * @return unreadOnly
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly")

  public Boolean getUnreadOnly() {
    return unreadOnly;
  }


  public void setUnreadOnly(Boolean unreadOnly) {
    this.unreadOnly = unreadOnly;
  }


  public SearchEmailsOptions searchFilter(String searchFilter) {
    
    this.searchFilter = searchFilter;
    return this;
  }

   /**
   * Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body
   * @return searchFilter
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body")

  public String getSearchFilter() {
    return searchFilter;
  }


  public void setSearchFilter(String searchFilter) {
    this.searchFilter = searchFilter;
  }


  public SearchEmailsOptions since(OffsetDateTime since) {
    
    this.since = since;
    return this;
  }

   /**
   * Optional filter emails received after given date time
   * @return since
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional filter emails received after given date time")

  public OffsetDateTime getSince() {
    return since;
  }


  public void setSince(OffsetDateTime since) {
    this.since = since;
  }


  public SearchEmailsOptions before(OffsetDateTime before) {
    
    this.before = before;
    return this;
  }

   /**
   * Optional filter emails received before given date time
   * @return before
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Optional filter emails received before given date time")

  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;
    }
    SearchEmailsOptions searchEmailsOptions = (SearchEmailsOptions) o;
    return Objects.equals(this.inboxIds, searchEmailsOptions.inboxIds) &&
        Objects.equals(this.pageIndex, searchEmailsOptions.pageIndex) &&
        Objects.equals(this.pageSize, searchEmailsOptions.pageSize) &&
        Objects.equals(this.sortDirection, searchEmailsOptions.sortDirection) &&
        Objects.equals(this.unreadOnly, searchEmailsOptions.unreadOnly) &&
        Objects.equals(this.searchFilter, searchEmailsOptions.searchFilter) &&
        Objects.equals(this.since, searchEmailsOptions.since) &&
        Objects.equals(this.before, searchEmailsOptions.before);
  }

  @Override
  public int hashCode() {
    return Objects.hash(inboxIds, pageIndex, pageSize, sortDirection, unreadOnly, searchFilter, since, before);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SearchEmailsOptions {\n");
    sb.append("    inboxIds: ").append(toIndentedString(inboxIds)).append("\n");
    sb.append("    pageIndex: ").append(toIndentedString(pageIndex)).append("\n");
    sb.append("    pageSize: ").append(toIndentedString(pageSize)).append("\n");
    sb.append("    sortDirection: ").append(toIndentedString(sortDirection)).append("\n");
    sb.append("    unreadOnly: ").append(toIndentedString(unreadOnly)).append("\n");
    sb.append("    searchFilter: ").append(toIndentedString(searchFilter)).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    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy