https://github.com/mailslurp/mailslurp-client-java
/*
* 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: contact@mailslurp.dev
*
* 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.WebhookTestRequest;
import com.mailslurp.models.WebhookTestResponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Results of testing a webhook
*/
@ApiModel(description = "Results of testing a webhook")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookTestResult {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_RESPONSE = "response";
@SerializedName(SERIALIZED_NAME_RESPONSE)
private WebhookTestResponse response;
public static final String SERIALIZED_NAME_REQUEST = "request";
@SerializedName(SERIALIZED_NAME_REQUEST)
private WebhookTestRequest request;
public WebhookTestResult() {
}
public WebhookTestResult message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public WebhookTestResult response(WebhookTestResponse response) {
this.response = response;
return this;
}
/**
* Get response
* @return response
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public WebhookTestResponse getResponse() {
return response;
}
public void setResponse(WebhookTestResponse response) {
this.response = response;
}
public WebhookTestResult request(WebhookTestRequest request) {
this.request = request;
return this;
}
/**
* Get request
* @return request
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public WebhookTestRequest getRequest() {
return request;
}
public void setRequest(WebhookTestRequest request) {
this.request = request;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookTestResult webhookTestResult = (WebhookTestResult) o;
return Objects.equals(this.message, webhookTestResult.message) &&
Objects.equals(this.response, webhookTestResult.response) &&
Objects.equals(this.request, webhookTestResult.request);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(message, response, request);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookTestResult {\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" response: ").append(toIndentedString(response)).append("\n");
sb.append(" request: ").append(toIndentedString(request)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("message");
openapiFields.add("response");
openapiFields.add("request");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("response");
openapiRequiredFields.add("request");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookTestResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookTestResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookTestResult is not found in the empty JSON string", WebhookTestResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookTestResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookTestResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookTestResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
// validate the required field `response`
WebhookTestResponse.validateJsonObject(jsonObj.getAsJsonObject("response"));
// validate the required field `request`
WebhookTestRequest.validateJsonObject(jsonObj.getAsJsonObject("request"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookTestResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookTestResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookTestResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookTestResult.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookTestResult>() {
@Override
public void write(JsonWriter out, WebhookTestResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookTestResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookTestResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookTestResult
* @throws IOException if the JSON string is invalid with respect to WebhookTestResult
*/
public static WebhookTestResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookTestResult.class);
}
/**
* Convert an instance of WebhookTestResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Response from webhook test request
*/
@ApiModel(description = "Response from webhook test request")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookTestResponse {
public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode";
@SerializedName(SERIALIZED_NAME_STATUS_CODE)
private Integer statusCode;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public WebhookTestResponse() {
}
public WebhookTestResponse statusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
/**
* Get statusCode
* @return statusCode
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getStatusCode() {
return statusCode;
}
public void setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
}
public WebhookTestResponse message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookTestResponse webhookTestResponse = (WebhookTestResponse) o;
return Objects.equals(this.statusCode, webhookTestResponse.statusCode) &&
Objects.equals(this.message, webhookTestResponse.message);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(statusCode, message);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookTestResponse {\n");
sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("statusCode");
openapiFields.add("message");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookTestResponse
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookTestResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookTestResponse is not found in the empty JSON string", WebhookTestResponse.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookTestResponse.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookTestResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookTestResponse.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookTestResponse' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookTestResponse> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookTestResponse.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookTestResponse>() {
@Override
public void write(JsonWriter out, WebhookTestResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookTestResponse read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookTestResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookTestResponse
* @throws IOException if the JSON string is invalid with respect to WebhookTestResponse
*/
public static WebhookTestResponse fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookTestResponse.class);
}
/**
* Convert an instance of WebhookTestResponse to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of webhook test request
*/
@ApiModel(description = "Result of webhook test request")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookTestRequest {
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
/**
* Gets or Sets method
*/
@JsonAdapter(MethodEnum.Adapter.class)
public enum MethodEnum {
GET("GET"),
HEAD("HEAD"),
POST("POST"),
PUT("PUT"),
PATCH("PATCH"),
DELETE("DELETE"),
OPTIONS("OPTIONS"),
TRACE("TRACE");
private String value;
MethodEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static MethodEnum fromValue(String value) {
for (MethodEnum b : MethodEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<MethodEnum> {
@Override
public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public MethodEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return MethodEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_METHOD = "method";
@SerializedName(SERIALIZED_NAME_METHOD)
private MethodEnum method;
public static final String SERIALIZED_NAME_HEADERS = "headers";
@SerializedName(SERIALIZED_NAME_HEADERS)
private Map<String, String> headers = new HashMap<>();
public static final String SERIALIZED_NAME_PAYLOAD = "payload";
@SerializedName(SERIALIZED_NAME_PAYLOAD)
private String payload;
public WebhookTestRequest() {
}
public WebhookTestRequest url(String url) {
this.url = url;
return this;
}
/**
* Get url
* @return url
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public WebhookTestRequest method(MethodEnum method) {
this.method = method;
return this;
}
/**
* Get method
* @return method
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public MethodEnum getMethod() {
return method;
}
public void setMethod(MethodEnum method) {
this.method = method;
}
public WebhookTestRequest headers(Map<String, String> headers) {
this.headers = headers;
return this;
}
public WebhookTestRequest putHeadersItem(String key, String headersItem) {
this.headers.put(key, headersItem);
return this;
}
/**
* Get headers
* @return headers
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Map<String, String> getHeaders() {
return headers;
}
public void setHeaders(Map<String, String> headers) {
this.headers = headers;
}
public WebhookTestRequest payload(String payload) {
this.payload = payload;
return this;
}
/**
* Get payload
* @return payload
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getPayload() {
return payload;
}
public void setPayload(String payload) {
this.payload = payload;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookTestRequest webhookTestRequest = (WebhookTestRequest) o;
return Objects.equals(this.url, webhookTestRequest.url) &&
Objects.equals(this.method, webhookTestRequest.method) &&
Objects.equals(this.headers, webhookTestRequest.headers) &&
Objects.equals(this.payload, webhookTestRequest.payload);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(url, method, headers, payload);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookTestRequest {\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" method: ").append(toIndentedString(method)).append("\n");
sb.append(" headers: ").append(toIndentedString(headers)).append("\n");
sb.append(" payload: ").append(toIndentedString(payload)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("url");
openapiFields.add("method");
openapiFields.add("headers");
openapiFields.add("payload");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("url");
openapiRequiredFields.add("method");
openapiRequiredFields.add("headers");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookTestRequest
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookTestRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookTestRequest is not found in the empty JSON string", WebhookTestRequest.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookTestRequest.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookTestRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookTestRequest.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("url").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString()));
}
if (!jsonObj.get("method").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString()));
}
if ((jsonObj.get("payload") != null && !jsonObj.get("payload").isJsonNull()) && !jsonObj.get("payload").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookTestRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookTestRequest' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookTestRequest> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookTestRequest.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookTestRequest>() {
@Override
public void write(JsonWriter out, WebhookTestRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookTestRequest read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookTestRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookTestRequest
* @throws IOException if the JSON string is invalid with respect to WebhookTestRequest
*/
public static WebhookTestRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookTestRequest.class);
}
/**
* Convert an instance of WebhookTestRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of a webhook notification
*/
@ApiModel(description = "Result of a webhook notification")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookResultDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
public static final String SERIALIZED_NAME_WEBHOOK_URL = "webhookUrl";
@SerializedName(SERIALIZED_NAME_WEBHOOK_URL)
private String webhookUrl;
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_REDRIVE_ID = "redriveId";
@SerializedName(SERIALIZED_NAME_REDRIVE_ID)
private UUID redriveId;
/**
* Gets or Sets httpMethod
*/
@JsonAdapter(HttpMethodEnum.Adapter.class)
public enum HttpMethodEnum {
GET("GET"),
HEAD("HEAD"),
POST("POST"),
PUT("PUT"),
PATCH("PATCH"),
DELETE("DELETE"),
OPTIONS("OPTIONS"),
TRACE("TRACE");
private String value;
HttpMethodEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static HttpMethodEnum fromValue(String value) {
for (HttpMethodEnum b : HttpMethodEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<HttpMethodEnum> {
@Override
public void write(final JsonWriter jsonWriter, final HttpMethodEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public HttpMethodEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return HttpMethodEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_HTTP_METHOD = "httpMethod";
@SerializedName(SERIALIZED_NAME_HTTP_METHOD)
private HttpMethodEnum httpMethod;
/**
* Gets or Sets webhookEvent
*/
@JsonAdapter(WebhookEventEnum.Adapter.class)
public enum WebhookEventEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
WebhookEventEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static WebhookEventEnum fromValue(String value) {
for (WebhookEventEnum b : WebhookEventEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<WebhookEventEnum> {
@Override
public void write(final JsonWriter jsonWriter, final WebhookEventEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public WebhookEventEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return WebhookEventEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_WEBHOOK_EVENT = "webhookEvent";
@SerializedName(SERIALIZED_NAME_WEBHOOK_EVENT)
private WebhookEventEnum webhookEvent;
public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus";
@SerializedName(SERIALIZED_NAME_RESPONSE_STATUS)
private Integer responseStatus;
public static final String SERIALIZED_NAME_RESPONSE_TIME_MILLIS = "responseTimeMillis";
@SerializedName(SERIALIZED_NAME_RESPONSE_TIME_MILLIS)
private Long responseTimeMillis;
public static final String SERIALIZED_NAME_RESPONSE_BODY_EXTRACT = "responseBodyExtract";
@SerializedName(SERIALIZED_NAME_RESPONSE_BODY_EXTRACT)
private String responseBodyExtract;
/**
* Gets or Sets resultType
*/
@JsonAdapter(ResultTypeEnum.Adapter.class)
public enum ResultTypeEnum {
BAD_RESPONSE("BAD_RESPONSE"),
EXCEPTION("EXCEPTION"),
SUCCESS("SUCCESS");
private String value;
ResultTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ResultTypeEnum fromValue(String value) {
for (ResultTypeEnum b : ResultTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<ResultTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ResultTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ResultTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ResultTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_RESULT_TYPE = "resultType";
@SerializedName(SERIALIZED_NAME_RESULT_TYPE)
private ResultTypeEnum resultType;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_SEEN = "seen";
@SerializedName(SERIALIZED_NAME_SEEN)
private Boolean seen;
public WebhookResultDto() {
}
public WebhookResultDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public WebhookResultDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public WebhookResultDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookResultDto webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* Get webhookId
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookResultDto webhookUrl(String webhookUrl) {
this.webhookUrl = webhookUrl;
return this;
}
/**
* Get webhookUrl
* @return webhookUrl
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getWebhookUrl() {
return webhookUrl;
}
public void setWebhookUrl(String webhookUrl) {
this.webhookUrl = webhookUrl;
}
public WebhookResultDto messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Get messageId
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookResultDto redriveId(UUID redriveId) {
this.redriveId = redriveId;
return this;
}
/**
* Get redriveId
* @return redriveId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getRedriveId() {
return redriveId;
}
public void setRedriveId(UUID redriveId) {
this.redriveId = redriveId;
}
public WebhookResultDto httpMethod(HttpMethodEnum httpMethod) {
this.httpMethod = httpMethod;
return this;
}
/**
* Get httpMethod
* @return httpMethod
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public HttpMethodEnum getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(HttpMethodEnum httpMethod) {
this.httpMethod = httpMethod;
}
public WebhookResultDto webhookEvent(WebhookEventEnum webhookEvent) {
this.webhookEvent = webhookEvent;
return this;
}
/**
* Get webhookEvent
* @return webhookEvent
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public WebhookEventEnum getWebhookEvent() {
return webhookEvent;
}
public void setWebhookEvent(WebhookEventEnum webhookEvent) {
this.webhookEvent = webhookEvent;
}
public WebhookResultDto responseStatus(Integer responseStatus) {
this.responseStatus = responseStatus;
return this;
}
/**
* Get responseStatus
* @return responseStatus
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getResponseStatus() {
return responseStatus;
}
public void setResponseStatus(Integer responseStatus) {
this.responseStatus = responseStatus;
}
public WebhookResultDto responseTimeMillis(Long responseTimeMillis) {
this.responseTimeMillis = responseTimeMillis;
return this;
}
/**
* Get responseTimeMillis
* @return responseTimeMillis
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getResponseTimeMillis() {
return responseTimeMillis;
}
public void setResponseTimeMillis(Long responseTimeMillis) {
this.responseTimeMillis = responseTimeMillis;
}
public WebhookResultDto responseBodyExtract(String responseBodyExtract) {
this.responseBodyExtract = responseBodyExtract;
return this;
}
/**
* Get responseBodyExtract
* @return responseBodyExtract
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getResponseBodyExtract() {
return responseBodyExtract;
}
public void setResponseBodyExtract(String responseBodyExtract) {
this.responseBodyExtract = responseBodyExtract;
}
public WebhookResultDto resultType(ResultTypeEnum resultType) {
this.resultType = resultType;
return this;
}
/**
* Get resultType
* @return resultType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public ResultTypeEnum getResultType() {
return resultType;
}
public void setResultType(ResultTypeEnum resultType) {
this.resultType = resultType;
}
public WebhookResultDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public WebhookResultDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public WebhookResultDto seen(Boolean seen) {
this.seen = seen;
return this;
}
/**
* Get seen
* @return seen
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSeen() {
return seen;
}
public void setSeen(Boolean seen) {
this.seen = seen;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookResultDto webhookResultDto = (WebhookResultDto) o;
return Objects.equals(this.id, webhookResultDto.id) &&
Objects.equals(this.userId, webhookResultDto.userId) &&
Objects.equals(this.inboxId, webhookResultDto.inboxId) &&
Objects.equals(this.webhookId, webhookResultDto.webhookId) &&
Objects.equals(this.webhookUrl, webhookResultDto.webhookUrl) &&
Objects.equals(this.messageId, webhookResultDto.messageId) &&
Objects.equals(this.redriveId, webhookResultDto.redriveId) &&
Objects.equals(this.httpMethod, webhookResultDto.httpMethod) &&
Objects.equals(this.webhookEvent, webhookResultDto.webhookEvent) &&
Objects.equals(this.responseStatus, webhookResultDto.responseStatus) &&
Objects.equals(this.responseTimeMillis, webhookResultDto.responseTimeMillis) &&
Objects.equals(this.responseBodyExtract, webhookResultDto.responseBodyExtract) &&
Objects.equals(this.resultType, webhookResultDto.resultType) &&
Objects.equals(this.createdAt, webhookResultDto.createdAt) &&
Objects.equals(this.updatedAt, webhookResultDto.updatedAt) &&
Objects.equals(this.seen, webhookResultDto.seen);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, inboxId, webhookId, webhookUrl, messageId, redriveId, httpMethod, webhookEvent, responseStatus, responseTimeMillis, responseBodyExtract, resultType, createdAt, updatedAt, seen);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookResultDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" redriveId: ").append(toIndentedString(redriveId)).append("\n");
sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n");
sb.append(" webhookEvent: ").append(toIndentedString(webhookEvent)).append("\n");
sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n");
sb.append(" responseTimeMillis: ").append(toIndentedString(responseTimeMillis)).append("\n");
sb.append(" responseBodyExtract: ").append(toIndentedString(responseBodyExtract)).append("\n");
sb.append(" resultType: ").append(toIndentedString(resultType)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" seen: ").append(toIndentedString(seen)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("inboxId");
openapiFields.add("webhookId");
openapiFields.add("webhookUrl");
openapiFields.add("messageId");
openapiFields.add("redriveId");
openapiFields.add("httpMethod");
openapiFields.add("webhookEvent");
openapiFields.add("responseStatus");
openapiFields.add("responseTimeMillis");
openapiFields.add("responseBodyExtract");
openapiFields.add("resultType");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("seen");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("userId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("webhookUrl");
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("httpMethod");
openapiRequiredFields.add("webhookEvent");
openapiRequiredFields.add("responseTimeMillis");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
openapiRequiredFields.add("seen");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookResultDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookResultDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookResultDto is not found in the empty JSON string", WebhookResultDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookResultDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookResultDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookResultDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("webhookUrl").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookUrl").toString()));
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if ((jsonObj.get("redriveId") != null && !jsonObj.get("redriveId").isJsonNull()) && !jsonObj.get("redriveId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `redriveId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redriveId").toString()));
}
if (!jsonObj.get("httpMethod").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `httpMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("httpMethod").toString()));
}
if (!jsonObj.get("webhookEvent").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookEvent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookEvent").toString()));
}
if ((jsonObj.get("responseBodyExtract") != null && !jsonObj.get("responseBodyExtract").isJsonNull()) && !jsonObj.get("responseBodyExtract").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `responseBodyExtract` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseBodyExtract").toString()));
}
if ((jsonObj.get("resultType") != null && !jsonObj.get("resultType").isJsonNull()) && !jsonObj.get("resultType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `resultType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookResultDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookResultDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookResultDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookResultDto.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookResultDto>() {
@Override
public void write(JsonWriter out, WebhookResultDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookResultDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookResultDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookResultDto
* @throws IOException if the JSON string is invalid with respect to WebhookResultDto
*/
public static WebhookResultDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookResultDto.class);
}
/**
* Convert an instance of WebhookResultDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of retrying webhook
*/
@ApiModel(description = "Result of retrying webhook")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookRedriveResult {
public static final String SERIALIZED_NAME_WEBHOOK_RESULT_ID = "webhookResultId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_RESULT_ID)
private UUID webhookResultId;
public static final String SERIALIZED_NAME_SUCCESS = "success";
@SerializedName(SERIALIZED_NAME_SUCCESS)
private Boolean success;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public WebhookRedriveResult() {
}
public WebhookRedriveResult webhookResultId(UUID webhookResultId) {
this.webhookResultId = webhookResultId;
return this;
}
/**
* Get webhookResultId
* @return webhookResultId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getWebhookResultId() {
return webhookResultId;
}
public void setWebhookResultId(UUID webhookResultId) {
this.webhookResultId = webhookResultId;
}
public WebhookRedriveResult success(Boolean success) {
this.success = success;
return this;
}
/**
* Get success
* @return success
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public WebhookRedriveResult message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookRedriveResult webhookRedriveResult = (WebhookRedriveResult) o;
return Objects.equals(this.webhookResultId, webhookRedriveResult.webhookResultId) &&
Objects.equals(this.success, webhookRedriveResult.success) &&
Objects.equals(this.message, webhookRedriveResult.message);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(webhookResultId, success, message);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookRedriveResult {\n");
sb.append(" webhookResultId: ").append(toIndentedString(webhookResultId)).append("\n");
sb.append(" success: ").append(toIndentedString(success)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("webhookResultId");
openapiFields.add("success");
openapiFields.add("message");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("webhookResultId");
openapiRequiredFields.add("success");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookRedriveResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookRedriveResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookRedriveResult is not found in the empty JSON string", WebhookRedriveResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookRedriveResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookRedriveResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookRedriveResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("webhookResultId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookResultId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookResultId").toString()));
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookRedriveResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookRedriveResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookRedriveResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookRedriveResult.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookRedriveResult>() {
@Override
public void write(JsonWriter out, WebhookRedriveResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookRedriveResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookRedriveResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookRedriveResult
* @throws IOException if the JSON string is invalid with respect to WebhookRedriveResult
*/
public static WebhookRedriveResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookRedriveResult.class);
}
/**
* Convert an instance of WebhookRedriveResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Representation of a webhook
*/
@ApiModel(description = "Representation of a webhook")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
/**
* Gets or Sets eventName
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_PHONE_NUMBER_ID = "phoneNumberId";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER_ID)
private UUID phoneNumberId;
public WebhookProjection() {
}
public WebhookProjection name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public WebhookProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public WebhookProjection url(String url) {
this.url = url;
return this;
}
/**
* Get url
* @return url
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public WebhookProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookProjection eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Get eventName
* @return eventName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public WebhookProjection updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public WebhookProjection phoneNumberId(UUID phoneNumberId) {
this.phoneNumberId = phoneNumberId;
return this;
}
/**
* Get phoneNumberId
* @return phoneNumberId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getPhoneNumberId() {
return phoneNumberId;
}
public void setPhoneNumberId(UUID phoneNumberId) {
this.phoneNumberId = phoneNumberId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookProjection webhookProjection = (WebhookProjection) o;
return Objects.equals(this.name, webhookProjection.name) &&
Objects.equals(this.id, webhookProjection.id) &&
Objects.equals(this.url, webhookProjection.url) &&
Objects.equals(this.inboxId, webhookProjection.inboxId) &&
Objects.equals(this.eventName, webhookProjection.eventName) &&
Objects.equals(this.createdAt, webhookProjection.createdAt) &&
Objects.equals(this.updatedAt, webhookProjection.updatedAt) &&
Objects.equals(this.phoneNumberId, webhookProjection.phoneNumberId);
}
@Override
public int hashCode() {
return Objects.hash(name, id, url, inboxId, eventName, createdAt, updatedAt, phoneNumberId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" phoneNumberId: ").append(toIndentedString(phoneNumberId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("id");
openapiFields.add("url");
openapiFields.add("inboxId");
openapiFields.add("eventName");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("phoneNumberId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("url");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookProjection is not found in the empty JSON string", WebhookProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("url").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonNull()) && !jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("phoneNumberId") != null && !jsonObj.get("phoneNumberId").isJsonNull()) && !jsonObj.get("phoneNumberId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookProjection.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookProjection>() {
@Override
public void write(JsonWriter out, WebhookProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookProjection
* @throws IOException if the JSON string is invalid with respect to WebhookProjection
*/
public static WebhookProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookProjection.class);
}
/**
* Convert an instance of WebhookProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* NEW_SMS webhook payload. Sent to your webhook url endpoint via HTTP POST when an sms is received by the phone number that your webhook is attached to. Use the SMS ID to fetch the full SMS details.
*/
@ApiModel(description = "NEW_SMS webhook payload. Sent to your webhook url endpoint via HTTP POST when an sms is received by the phone number that your webhook is attached to. Use the SMS ID to fetch the full SMS details.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookNewSmsPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_SMS_ID = "smsId";
@SerializedName(SERIALIZED_NAME_SMS_ID)
private UUID smsId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
private UUID phoneNumber;
public static final String SERIALIZED_NAME_TO_NUMBER = "toNumber";
@SerializedName(SERIALIZED_NAME_TO_NUMBER)
private String toNumber;
public static final String SERIALIZED_NAME_FROM_NUMBER = "fromNumber";
@SerializedName(SERIALIZED_NAME_FROM_NUMBER)
private String fromNumber;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_READ = "read";
@SerializedName(SERIALIZED_NAME_READ)
private Boolean read;
public WebhookNewSmsPayload() {
}
public WebhookNewSmsPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookNewSmsPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookNewSmsPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookNewSmsPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookNewSmsPayload smsId(UUID smsId) {
this.smsId = smsId;
return this;
}
/**
* ID of SMS message
* @return smsId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of SMS message")
public UUID getSmsId() {
return smsId;
}
public void setSmsId(UUID smsId) {
this.smsId = smsId;
}
public WebhookNewSmsPayload userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* User ID of event
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "User ID of event")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public WebhookNewSmsPayload phoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* ID of phone number receiving SMS
* @return phoneNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of phone number receiving SMS")
public UUID getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
}
public WebhookNewSmsPayload toNumber(String toNumber) {
this.toNumber = toNumber;
return this;
}
/**
* Recipient phone number
* @return toNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Recipient phone number")
public String getToNumber() {
return toNumber;
}
public void setToNumber(String toNumber) {
this.toNumber = toNumber;
}
public WebhookNewSmsPayload fromNumber(String fromNumber) {
this.fromNumber = fromNumber;
return this;
}
/**
* Sender phone number
* @return fromNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Sender phone number")
public String getFromNumber() {
return fromNumber;
}
public void setFromNumber(String fromNumber) {
this.fromNumber = fromNumber;
}
public WebhookNewSmsPayload body(String body) {
this.body = body;
return this;
}
/**
* SMS message body
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "SMS message body")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public WebhookNewSmsPayload read(Boolean read) {
this.read = read;
return this;
}
/**
* SMS has been read
* @return read
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "SMS has been read")
public Boolean getRead() {
return read;
}
public void setRead(Boolean read) {
this.read = read;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookNewSmsPayload webhookNewSmsPayload = (WebhookNewSmsPayload) o;
return Objects.equals(this.messageId, webhookNewSmsPayload.messageId) &&
Objects.equals(this.webhookId, webhookNewSmsPayload.webhookId) &&
Objects.equals(this.eventName, webhookNewSmsPayload.eventName) &&
Objects.equals(this.webhookName, webhookNewSmsPayload.webhookName) &&
Objects.equals(this.smsId, webhookNewSmsPayload.smsId) &&
Objects.equals(this.userId, webhookNewSmsPayload.userId) &&
Objects.equals(this.phoneNumber, webhookNewSmsPayload.phoneNumber) &&
Objects.equals(this.toNumber, webhookNewSmsPayload.toNumber) &&
Objects.equals(this.fromNumber, webhookNewSmsPayload.fromNumber) &&
Objects.equals(this.body, webhookNewSmsPayload.body) &&
Objects.equals(this.read, webhookNewSmsPayload.read);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, smsId, userId, phoneNumber, toNumber, fromNumber, body, read);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookNewSmsPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" smsId: ").append(toIndentedString(smsId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" toNumber: ").append(toIndentedString(toNumber)).append("\n");
sb.append(" fromNumber: ").append(toIndentedString(fromNumber)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" read: ").append(toIndentedString(read)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("smsId");
openapiFields.add("userId");
openapiFields.add("phoneNumber");
openapiFields.add("toNumber");
openapiFields.add("fromNumber");
openapiFields.add("body");
openapiFields.add("read");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("smsId");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("phoneNumber");
openapiRequiredFields.add("toNumber");
openapiRequiredFields.add("fromNumber");
openapiRequiredFields.add("body");
openapiRequiredFields.add("read");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookNewSmsPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookNewSmsPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookNewSmsPayload is not found in the empty JSON string", WebhookNewSmsPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookNewSmsPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookNewSmsPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookNewSmsPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("smsId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `smsId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsId").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("phoneNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString()));
}
if (!jsonObj.get("toNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `toNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toNumber").toString()));
}
if (!jsonObj.get("fromNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `fromNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromNumber").toString()));
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookNewSmsPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookNewSmsPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookNewSmsPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookNewSmsPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookNewSmsPayload>() {
@Override
public void write(JsonWriter out, WebhookNewSmsPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookNewSmsPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookNewSmsPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookNewSmsPayload
* @throws IOException if the JSON string is invalid with respect to WebhookNewSmsPayload
*/
public static WebhookNewSmsPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookNewSmsPayload.class);
}
/**
* Convert an instance of WebhookNewSmsPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.AttachmentMetaData;
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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* NEW_EMAIL webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to. Use the email ID to fetch the full email body or attachments.
*/
@ApiModel(description = "NEW_EMAIL webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to. Use the email ID to fetch the full email body or attachments.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookNewEmailPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_EMAIL_ID = "emailId";
@SerializedName(SERIALIZED_NAME_EMAIL_ID)
private UUID emailId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = new ArrayList<>();
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = new ArrayList<>();
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_ATTACHMENT_META_DATAS = "attachmentMetaDatas";
@SerializedName(SERIALIZED_NAME_ATTACHMENT_META_DATAS)
private List<AttachmentMetaData> attachmentMetaDatas = new ArrayList<>();
public WebhookNewEmailPayload() {
}
public WebhookNewEmailPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookNewEmailPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookNewEmailPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookNewEmailPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookNewEmailPayload inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Id of the inbox
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Id of the inbox")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookNewEmailPayload domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* Id of the domain that received an email
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Id of the domain that received an email")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public WebhookNewEmailPayload emailId(UUID emailId) {
this.emailId = emailId;
return this;
}
/**
* ID of the email that was received. Use this ID for fetching the email with the `EmailController`.
* @return emailId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the email that was received. Use this ID for fetching the email with the `EmailController`.")
public UUID getEmailId() {
return emailId;
}
public void setEmailId(UUID emailId) {
this.emailId = emailId;
}
public WebhookNewEmailPayload createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Date time of event creation
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Date time of event creation")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public WebhookNewEmailPayload to(List<String> to) {
this.to = to;
return this;
}
public WebhookNewEmailPayload addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* List of `To` recipient email addresses that the email was addressed to. See recipients object for names.
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of `To` recipient email addresses that the email was addressed to. See recipients object for names.")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public WebhookNewEmailPayload from(String from) {
this.from = from;
return this;
}
/**
* Who the email was sent from. An email address - see fromName for the sender name.
* @return from
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Who the email was sent from. An email address - see fromName for the sender name.")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public WebhookNewEmailPayload cc(List<String> cc) {
this.cc = cc;
return this;
}
public WebhookNewEmailPayload addCcItem(String ccItem) {
this.cc.add(ccItem);
return this;
}
/**
* List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.
* @return cc
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public WebhookNewEmailPayload bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public WebhookNewEmailPayload addBccItem(String bccItem) {
this.bcc.add(bccItem);
return this;
}
/**
* List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.
* @return bcc
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public WebhookNewEmailPayload subject(String subject) {
this.subject = subject;
return this;
}
/**
* The subject line of the email message as specified by SMTP subject header
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The subject line of the email message as specified by SMTP subject header")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public WebhookNewEmailPayload attachmentMetaDatas(List<AttachmentMetaData> attachmentMetaDatas) {
this.attachmentMetaDatas = attachmentMetaDatas;
return this;
}
public WebhookNewEmailPayload addAttachmentMetaDatasItem(AttachmentMetaData attachmentMetaDatasItem) {
this.attachmentMetaDatas.add(attachmentMetaDatasItem);
return this;
}
/**
* List of attachment meta data objects if attachments present
* @return attachmentMetaDatas
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of attachment meta data objects if attachments present")
public List<AttachmentMetaData> getAttachmentMetaDatas() {
return attachmentMetaDatas;
}
public void setAttachmentMetaDatas(List<AttachmentMetaData> attachmentMetaDatas) {
this.attachmentMetaDatas = attachmentMetaDatas;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookNewEmailPayload webhookNewEmailPayload = (WebhookNewEmailPayload) o;
return Objects.equals(this.messageId, webhookNewEmailPayload.messageId) &&
Objects.equals(this.webhookId, webhookNewEmailPayload.webhookId) &&
Objects.equals(this.eventName, webhookNewEmailPayload.eventName) &&
Objects.equals(this.webhookName, webhookNewEmailPayload.webhookName) &&
Objects.equals(this.inboxId, webhookNewEmailPayload.inboxId) &&
Objects.equals(this.domainId, webhookNewEmailPayload.domainId) &&
Objects.equals(this.emailId, webhookNewEmailPayload.emailId) &&
Objects.equals(this.createdAt, webhookNewEmailPayload.createdAt) &&
Objects.equals(this.to, webhookNewEmailPayload.to) &&
Objects.equals(this.from, webhookNewEmailPayload.from) &&
Objects.equals(this.cc, webhookNewEmailPayload.cc) &&
Objects.equals(this.bcc, webhookNewEmailPayload.bcc) &&
Objects.equals(this.subject, webhookNewEmailPayload.subject) &&
Objects.equals(this.attachmentMetaDatas, webhookNewEmailPayload.attachmentMetaDatas);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, inboxId, domainId, emailId, createdAt, to, from, cc, bcc, subject, attachmentMetaDatas);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookNewEmailPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" emailId: ").append(toIndentedString(emailId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" attachmentMetaDatas: ").append(toIndentedString(attachmentMetaDatas)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("inboxId");
openapiFields.add("domainId");
openapiFields.add("emailId");
openapiFields.add("createdAt");
openapiFields.add("to");
openapiFields.add("from");
openapiFields.add("cc");
openapiFields.add("bcc");
openapiFields.add("subject");
openapiFields.add("attachmentMetaDatas");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("emailId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("to");
openapiRequiredFields.add("from");
openapiRequiredFields.add("cc");
openapiRequiredFields.add("bcc");
openapiRequiredFields.add("attachmentMetaDatas");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookNewEmailPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookNewEmailPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookNewEmailPayload is not found in the empty JSON string", WebhookNewEmailPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookNewEmailPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookNewEmailPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookNewEmailPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if (!jsonObj.get("emailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailId").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if (!jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
// ensure the required json array is present
if (jsonObj.get("cc") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the required json array is present
if (jsonObj.get("bcc") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("attachmentMetaDatas").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachmentMetaDatas` to be an array in the JSON string but got `%s`", jsonObj.get("attachmentMetaDatas").toString()));
}
JsonArray jsonArrayattachmentMetaDatas = jsonObj.getAsJsonArray("attachmentMetaDatas");
// validate the required field `attachmentMetaDatas` (array)
for (int i = 0; i < jsonArrayattachmentMetaDatas.size(); i++) {
AttachmentMetaData.validateJsonObject(jsonArrayattachmentMetaDatas.get(i).getAsJsonObject());
};
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookNewEmailPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookNewEmailPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookNewEmailPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookNewEmailPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookNewEmailPayload>() {
@Override
public void write(JsonWriter out, WebhookNewEmailPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookNewEmailPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookNewEmailPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookNewEmailPayload
* @throws IOException if the JSON string is invalid with respect to WebhookNewEmailPayload
*/
public static WebhookNewEmailPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookNewEmailPayload.class);
}
/**
* Convert an instance of WebhookNewEmailPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* NEW_CONTACT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains a recipient that has not been saved as a contact.
*/
@ApiModel(description = "NEW_CONTACT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains a recipient that has not been saved as a contact.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookNewContactPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_CONTACT_ID = "contactId";
@SerializedName(SERIALIZED_NAME_CONTACT_ID)
private UUID contactId;
public static final String SERIALIZED_NAME_GROUP_ID = "groupId";
@SerializedName(SERIALIZED_NAME_GROUP_ID)
private UUID groupId;
public static final String SERIALIZED_NAME_FIRST_NAME = "firstName";
@SerializedName(SERIALIZED_NAME_FIRST_NAME)
private String firstName;
public static final String SERIALIZED_NAME_LAST_NAME = "lastName";
@SerializedName(SERIALIZED_NAME_LAST_NAME)
private String lastName;
public static final String SERIALIZED_NAME_COMPANY = "company";
@SerializedName(SERIALIZED_NAME_COMPANY)
private String company;
public static final String SERIALIZED_NAME_PRIMARY_EMAIL_ADDRESS = "primaryEmailAddress";
@SerializedName(SERIALIZED_NAME_PRIMARY_EMAIL_ADDRESS)
private String primaryEmailAddress;
public static final String SERIALIZED_NAME_EMAIL_ADDRESSES = "emailAddresses";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESSES)
private List<String> emailAddresses = new ArrayList<>();
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = new ArrayList<>();
public static final String SERIALIZED_NAME_META_DATA = "metaData";
@SerializedName(SERIALIZED_NAME_META_DATA)
private Object metaData;
public static final String SERIALIZED_NAME_OPT_OUT = "optOut";
@SerializedName(SERIALIZED_NAME_OPT_OUT)
private Boolean optOut;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public WebhookNewContactPayload() {
}
public WebhookNewContactPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookNewContactPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookNewContactPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookNewContactPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookNewContactPayload contactId(UUID contactId) {
this.contactId = contactId;
return this;
}
/**
* Contact ID
* @return contactId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Contact ID")
public UUID getContactId() {
return contactId;
}
public void setContactId(UUID contactId) {
this.contactId = contactId;
}
public WebhookNewContactPayload groupId(UUID groupId) {
this.groupId = groupId;
return this;
}
/**
* Contact group ID
* @return groupId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Contact group ID")
public UUID getGroupId() {
return groupId;
}
public void setGroupId(UUID groupId) {
this.groupId = groupId;
}
public WebhookNewContactPayload firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Contact first name
* @return firstName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Contact first name")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public WebhookNewContactPayload lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Contact last name
* @return lastName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Contact last name")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public WebhookNewContactPayload company(String company) {
this.company = company;
return this;
}
/**
* Contact company name
* @return company
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Contact company name")
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public WebhookNewContactPayload primaryEmailAddress(String primaryEmailAddress) {
this.primaryEmailAddress = primaryEmailAddress;
return this;
}
/**
* Primary email address for contact
* @return primaryEmailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Primary email address for contact")
public String getPrimaryEmailAddress() {
return primaryEmailAddress;
}
public void setPrimaryEmailAddress(String primaryEmailAddress) {
this.primaryEmailAddress = primaryEmailAddress;
}
public WebhookNewContactPayload emailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
return this;
}
public WebhookNewContactPayload addEmailAddressesItem(String emailAddressesItem) {
this.emailAddresses.add(emailAddressesItem);
return this;
}
/**
* Email addresses for contact
* @return emailAddresses
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Email addresses for contact")
public List<String> getEmailAddresses() {
return emailAddresses;
}
public void setEmailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
}
public WebhookNewContactPayload tags(List<String> tags) {
this.tags = tags;
return this;
}
public WebhookNewContactPayload addTagsItem(String tagsItem) {
this.tags.add(tagsItem);
return this;
}
/**
* Tags for contact
* @return tags
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Tags for contact")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public WebhookNewContactPayload metaData(Object metaData) {
this.metaData = metaData;
return this;
}
/**
* Get metaData
* @return metaData
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Object getMetaData() {
return metaData;
}
public void setMetaData(Object metaData) {
this.metaData = metaData;
}
public WebhookNewContactPayload optOut(Boolean optOut) {
this.optOut = optOut;
return this;
}
/**
* Has contact opted out of emails
* @return optOut
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Has contact opted out of emails")
public Boolean getOptOut() {
return optOut;
}
public void setOptOut(Boolean optOut) {
this.optOut = optOut;
}
public WebhookNewContactPayload createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Date time of event creation
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Date time of event creation")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookNewContactPayload webhookNewContactPayload = (WebhookNewContactPayload) o;
return Objects.equals(this.messageId, webhookNewContactPayload.messageId) &&
Objects.equals(this.webhookId, webhookNewContactPayload.webhookId) &&
Objects.equals(this.webhookName, webhookNewContactPayload.webhookName) &&
Objects.equals(this.eventName, webhookNewContactPayload.eventName) &&
Objects.equals(this.contactId, webhookNewContactPayload.contactId) &&
Objects.equals(this.groupId, webhookNewContactPayload.groupId) &&
Objects.equals(this.firstName, webhookNewContactPayload.firstName) &&
Objects.equals(this.lastName, webhookNewContactPayload.lastName) &&
Objects.equals(this.company, webhookNewContactPayload.company) &&
Objects.equals(this.primaryEmailAddress, webhookNewContactPayload.primaryEmailAddress) &&
Objects.equals(this.emailAddresses, webhookNewContactPayload.emailAddresses) &&
Objects.equals(this.tags, webhookNewContactPayload.tags) &&
Objects.equals(this.metaData, webhookNewContactPayload.metaData) &&
Objects.equals(this.optOut, webhookNewContactPayload.optOut) &&
Objects.equals(this.createdAt, webhookNewContactPayload.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, webhookName, eventName, contactId, groupId, firstName, lastName, company, primaryEmailAddress, emailAddresses, tags, metaData, optOut, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookNewContactPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" contactId: ").append(toIndentedString(contactId)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" company: ").append(toIndentedString(company)).append("\n");
sb.append(" primaryEmailAddress: ").append(toIndentedString(primaryEmailAddress)).append("\n");
sb.append(" emailAddresses: ").append(toIndentedString(emailAddresses)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" metaData: ").append(toIndentedString(metaData)).append("\n");
sb.append(" optOut: ").append(toIndentedString(optOut)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("webhookName");
openapiFields.add("eventName");
openapiFields.add("contactId");
openapiFields.add("groupId");
openapiFields.add("firstName");
openapiFields.add("lastName");
openapiFields.add("company");
openapiFields.add("primaryEmailAddress");
openapiFields.add("emailAddresses");
openapiFields.add("tags");
openapiFields.add("metaData");
openapiFields.add("optOut");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("contactId");
openapiRequiredFields.add("emailAddresses");
openapiRequiredFields.add("tags");
openapiRequiredFields.add("optOut");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookNewContactPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookNewContactPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookNewContactPayload is not found in the empty JSON string", WebhookNewContactPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookNewContactPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookNewContactPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookNewContactPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if (!jsonObj.get("contactId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contactId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contactId").toString()));
}
if ((jsonObj.get("groupId") != null && !jsonObj.get("groupId").isJsonNull()) && !jsonObj.get("groupId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `groupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupId").toString()));
}
if ((jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonNull()) && !jsonObj.get("firstName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString()));
}
if ((jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonNull()) && !jsonObj.get("lastName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString()));
}
if ((jsonObj.get("company") != null && !jsonObj.get("company").isJsonNull()) && !jsonObj.get("company").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString()));
}
if ((jsonObj.get("primaryEmailAddress") != null && !jsonObj.get("primaryEmailAddress").isJsonNull()) && !jsonObj.get("primaryEmailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `primaryEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryEmailAddress").toString()));
}
// ensure the required json array is present
if (jsonObj.get("emailAddresses") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("emailAddresses").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("emailAddresses").toString()));
}
// ensure the required json array is present
if (jsonObj.get("tags") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookNewContactPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookNewContactPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookNewContactPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookNewContactPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookNewContactPayload>() {
@Override
public void write(JsonWriter out, WebhookNewContactPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookNewContactPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookNewContactPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookNewContactPayload
* @throws IOException if the JSON string is invalid with respect to WebhookNewContactPayload
*/
public static WebhookNewContactPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookNewContactPayload.class);
}
/**
* Convert an instance of WebhookNewContactPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* NEW_ATTACHMENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains an attachment. You can use the attachmentId to download the attachment.
*/
@ApiModel(description = "NEW_ATTACHMENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains an attachment. You can use the attachmentId to download the attachment.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookNewAttachmentPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_ATTACHMENT_ID = "attachmentId";
@SerializedName(SERIALIZED_NAME_ATTACHMENT_ID)
private String attachmentId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public static final String SERIALIZED_NAME_CONTENT_LENGTH = "contentLength";
@SerializedName(SERIALIZED_NAME_CONTENT_LENGTH)
private Long contentLength;
public WebhookNewAttachmentPayload() {
}
public WebhookNewAttachmentPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookNewAttachmentPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookNewAttachmentPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookNewAttachmentPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookNewAttachmentPayload attachmentId(String attachmentId) {
this.attachmentId = attachmentId;
return this;
}
/**
* ID of attachment. Use the `AttachmentController` to
* @return attachmentId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of attachment. Use the `AttachmentController` to")
public String getAttachmentId() {
return attachmentId;
}
public void setAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
}
public WebhookNewAttachmentPayload name(String name) {
this.name = name;
return this;
}
/**
* Filename of the attachment if present
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Filename of the attachment if present")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public WebhookNewAttachmentPayload contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Content type of attachment such as 'image/png' or 'application/pdf
* @return contentType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Content type of attachment such as 'image/png' or 'application/pdf")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public WebhookNewAttachmentPayload contentLength(Long contentLength) {
this.contentLength = contentLength;
return this;
}
/**
* Size of attachment in bytes
* @return contentLength
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Size of attachment in bytes")
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookNewAttachmentPayload webhookNewAttachmentPayload = (WebhookNewAttachmentPayload) o;
return Objects.equals(this.messageId, webhookNewAttachmentPayload.messageId) &&
Objects.equals(this.webhookId, webhookNewAttachmentPayload.webhookId) &&
Objects.equals(this.webhookName, webhookNewAttachmentPayload.webhookName) &&
Objects.equals(this.eventName, webhookNewAttachmentPayload.eventName) &&
Objects.equals(this.attachmentId, webhookNewAttachmentPayload.attachmentId) &&
Objects.equals(this.name, webhookNewAttachmentPayload.name) &&
Objects.equals(this.contentType, webhookNewAttachmentPayload.contentType) &&
Objects.equals(this.contentLength, webhookNewAttachmentPayload.contentLength);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, webhookName, eventName, attachmentId, name, contentType, contentLength);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookNewAttachmentPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" attachmentId: ").append(toIndentedString(attachmentId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
sb.append(" contentLength: ").append(toIndentedString(contentLength)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("webhookName");
openapiFields.add("eventName");
openapiFields.add("attachmentId");
openapiFields.add("name");
openapiFields.add("contentType");
openapiFields.add("contentLength");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("attachmentId");
openapiRequiredFields.add("name");
openapiRequiredFields.add("contentType");
openapiRequiredFields.add("contentLength");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookNewAttachmentPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookNewAttachmentPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookNewAttachmentPayload is not found in the empty JSON string", WebhookNewAttachmentPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookNewAttachmentPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookNewAttachmentPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookNewAttachmentPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if (!jsonObj.get("attachmentId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `attachmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attachmentId").toString()));
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("contentType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookNewAttachmentPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookNewAttachmentPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookNewAttachmentPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookNewAttachmentPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookNewAttachmentPayload>() {
@Override
public void write(JsonWriter out, WebhookNewAttachmentPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookNewAttachmentPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookNewAttachmentPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookNewAttachmentPayload
* @throws IOException if the JSON string is invalid with respect to WebhookNewAttachmentPayload
*/
public static WebhookNewAttachmentPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookNewAttachmentPayload.class);
}
/**
* Convert an instance of WebhookNewAttachmentPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.WebhookHeaderNameValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Webhook HTTP headers to include with each request from MailSlurp to your server
*/
@ApiModel(description = "Webhook HTTP headers to include with each request from MailSlurp to your server")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookHeaders {
public static final String SERIALIZED_NAME_HEADERS = "headers";
@SerializedName(SERIALIZED_NAME_HEADERS)
private List<WebhookHeaderNameValue> headers = new ArrayList<>();
public WebhookHeaders() {
}
public WebhookHeaders headers(List<WebhookHeaderNameValue> headers) {
this.headers = headers;
return this;
}
public WebhookHeaders addHeadersItem(WebhookHeaderNameValue headersItem) {
this.headers.add(headersItem);
return this;
}
/**
* List of header name value pairs to include with webhook requests
* @return headers
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of header name value pairs to include with webhook requests")
public List<WebhookHeaderNameValue> getHeaders() {
return headers;
}
public void setHeaders(List<WebhookHeaderNameValue> headers) {
this.headers = headers;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookHeaders webhookHeaders = (WebhookHeaders) o;
return Objects.equals(this.headers, webhookHeaders.headers);
}
@Override
public int hashCode() {
return Objects.hash(headers);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookHeaders {\n");
sb.append(" headers: ").append(toIndentedString(headers)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("headers");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("headers");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookHeaders
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookHeaders.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookHeaders is not found in the empty JSON string", WebhookHeaders.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookHeaders.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookHeaders` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookHeaders.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("headers").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `headers` to be an array in the JSON string but got `%s`", jsonObj.get("headers").toString()));
}
JsonArray jsonArrayheaders = jsonObj.getAsJsonArray("headers");
// validate the required field `headers` (array)
for (int i = 0; i < jsonArrayheaders.size(); i++) {
WebhookHeaderNameValue.validateJsonObject(jsonArrayheaders.get(i).getAsJsonObject());
};
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookHeaders.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookHeaders' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookHeaders> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookHeaders.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookHeaders>() {
@Override
public void write(JsonWriter out, WebhookHeaders value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookHeaders read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookHeaders given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookHeaders
* @throws IOException if the JSON string is invalid with respect to WebhookHeaders
*/
public static WebhookHeaders fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookHeaders.class);
}
/**
* Convert an instance of WebhookHeaders to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Name value pair for webhook header
*/
@ApiModel(description = "Name value pair for webhook header")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookHeaderNameValue {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private String value;
public WebhookHeaderNameValue() {
}
public WebhookHeaderNameValue name(String name) {
this.name = name;
return this;
}
/**
* Name of header
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of header")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public WebhookHeaderNameValue value(String value) {
this.value = value;
return this;
}
/**
* Value of header
* @return value
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Value of header")
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookHeaderNameValue webhookHeaderNameValue = (WebhookHeaderNameValue) o;
return Objects.equals(this.name, webhookHeaderNameValue.name) &&
Objects.equals(this.value, webhookHeaderNameValue.value);
}
@Override
public int hashCode() {
return Objects.hash(name, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookHeaderNameValue {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("value");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
openapiRequiredFields.add("value");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookHeaderNameValue
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookHeaderNameValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookHeaderNameValue is not found in the empty JSON string", WebhookHeaderNameValue.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookHeaderNameValue.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookHeaderNameValue` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookHeaderNameValue.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookHeaderNameValue.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookHeaderNameValue' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookHeaderNameValue> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookHeaderNameValue.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookHeaderNameValue>() {
@Override
public void write(JsonWriter out, WebhookHeaderNameValue value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookHeaderNameValue read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookHeaderNameValue given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookHeaderNameValue
* @throws IOException if the JSON string is invalid with respect to WebhookHeaderNameValue
*/
public static WebhookHeaderNameValue fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookHeaderNameValue.class);
}
/**
* Convert an instance of WebhookHeaderNameValue to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* EMAIL_READ webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is read. This happens when an email is requested in full from the API or a user views the email in the dashboard.
*/
@ApiModel(description = "EMAIL_READ webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is read. This happens when an email is requested in full from the API or a user views the email in the dashboard.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookEmailReadPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_EMAIL_ID = "emailId";
@SerializedName(SERIALIZED_NAME_EMAIL_ID)
private UUID emailId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_EMAIL_IS_READ = "emailIsRead";
@SerializedName(SERIALIZED_NAME_EMAIL_IS_READ)
private Boolean emailIsRead;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public WebhookEmailReadPayload() {
}
public WebhookEmailReadPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookEmailReadPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookEmailReadPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookEmailReadPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookEmailReadPayload emailId(UUID emailId) {
this.emailId = emailId;
return this;
}
/**
* ID of the email that was received. Use this ID for fetching the email with the `EmailController`.
* @return emailId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the email that was received. Use this ID for fetching the email with the `EmailController`.")
public UUID getEmailId() {
return emailId;
}
public void setEmailId(UUID emailId) {
this.emailId = emailId;
}
public WebhookEmailReadPayload inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Id of the inbox
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Id of the inbox")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookEmailReadPayload emailIsRead(Boolean emailIsRead) {
this.emailIsRead = emailIsRead;
return this;
}
/**
* Is the email read
* @return emailIsRead
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the email read")
public Boolean getEmailIsRead() {
return emailIsRead;
}
public void setEmailIsRead(Boolean emailIsRead) {
this.emailIsRead = emailIsRead;
}
public WebhookEmailReadPayload createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Date time of event creation
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Date time of event creation")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookEmailReadPayload webhookEmailReadPayload = (WebhookEmailReadPayload) o;
return Objects.equals(this.messageId, webhookEmailReadPayload.messageId) &&
Objects.equals(this.webhookId, webhookEmailReadPayload.webhookId) &&
Objects.equals(this.eventName, webhookEmailReadPayload.eventName) &&
Objects.equals(this.webhookName, webhookEmailReadPayload.webhookName) &&
Objects.equals(this.emailId, webhookEmailReadPayload.emailId) &&
Objects.equals(this.inboxId, webhookEmailReadPayload.inboxId) &&
Objects.equals(this.emailIsRead, webhookEmailReadPayload.emailIsRead) &&
Objects.equals(this.createdAt, webhookEmailReadPayload.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, emailId, inboxId, emailIsRead, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookEmailReadPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" emailId: ").append(toIndentedString(emailId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" emailIsRead: ").append(toIndentedString(emailIsRead)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("emailId");
openapiFields.add("inboxId");
openapiFields.add("emailIsRead");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("emailId");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("emailIsRead");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookEmailReadPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookEmailReadPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEmailReadPayload is not found in the empty JSON string", WebhookEmailReadPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookEmailReadPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookEmailReadPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookEmailReadPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("emailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailId").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookEmailReadPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookEmailReadPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookEmailReadPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookEmailReadPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookEmailReadPayload>() {
@Override
public void write(JsonWriter out, WebhookEmailReadPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookEmailReadPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookEmailReadPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookEmailReadPayload
* @throws IOException if the JSON string is invalid with respect to WebhookEmailReadPayload
*/
public static WebhookEmailReadPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookEmailReadPayload.class);
}
/**
* Convert an instance of WebhookEmailReadPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* EMAIL_OPENED webhook payload. Sent to your webhook url endpoint via HTTP POST when an email containing a tracking pixel is opened and the pixel image is loaded by a reader.
*/
@ApiModel(description = "EMAIL_OPENED webhook payload. Sent to your webhook url endpoint via HTTP POST when an email containing a tracking pixel is opened and the pixel image is loaded by a reader.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookEmailOpenedPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_PIXEL_ID = "pixelId";
@SerializedName(SERIALIZED_NAME_PIXEL_ID)
private UUID pixelId;
public static final String SERIALIZED_NAME_SENT_EMAIL_ID = "sentEmailId";
@SerializedName(SERIALIZED_NAME_SENT_EMAIL_ID)
private UUID sentEmailId;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public WebhookEmailOpenedPayload() {
}
public WebhookEmailOpenedPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookEmailOpenedPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookEmailOpenedPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookEmailOpenedPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookEmailOpenedPayload inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Id of the inbox
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Id of the inbox")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookEmailOpenedPayload pixelId(UUID pixelId) {
this.pixelId = pixelId;
return this;
}
/**
* ID of the tracking pixel
* @return pixelId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the tracking pixel")
public UUID getPixelId() {
return pixelId;
}
public void setPixelId(UUID pixelId) {
this.pixelId = pixelId;
}
public WebhookEmailOpenedPayload sentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
return this;
}
/**
* ID of sent email
* @return sentEmailId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of sent email")
public UUID getSentEmailId() {
return sentEmailId;
}
public void setSentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
}
public WebhookEmailOpenedPayload recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Email address for the recipient of the tracking pixel
* @return recipient
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Email address for the recipient of the tracking pixel")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
public WebhookEmailOpenedPayload createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Date time of event creation
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Date time of event creation")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookEmailOpenedPayload webhookEmailOpenedPayload = (WebhookEmailOpenedPayload) o;
return Objects.equals(this.messageId, webhookEmailOpenedPayload.messageId) &&
Objects.equals(this.webhookId, webhookEmailOpenedPayload.webhookId) &&
Objects.equals(this.eventName, webhookEmailOpenedPayload.eventName) &&
Objects.equals(this.webhookName, webhookEmailOpenedPayload.webhookName) &&
Objects.equals(this.inboxId, webhookEmailOpenedPayload.inboxId) &&
Objects.equals(this.pixelId, webhookEmailOpenedPayload.pixelId) &&
Objects.equals(this.sentEmailId, webhookEmailOpenedPayload.sentEmailId) &&
Objects.equals(this.recipient, webhookEmailOpenedPayload.recipient) &&
Objects.equals(this.createdAt, webhookEmailOpenedPayload.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, inboxId, pixelId, sentEmailId, recipient, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookEmailOpenedPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" pixelId: ").append(toIndentedString(pixelId)).append("\n");
sb.append(" sentEmailId: ").append(toIndentedString(sentEmailId)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("inboxId");
openapiFields.add("pixelId");
openapiFields.add("sentEmailId");
openapiFields.add("recipient");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("pixelId");
openapiRequiredFields.add("sentEmailId");
openapiRequiredFields.add("recipient");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookEmailOpenedPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookEmailOpenedPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookEmailOpenedPayload is not found in the empty JSON string", WebhookEmailOpenedPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookEmailOpenedPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookEmailOpenedPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookEmailOpenedPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("pixelId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `pixelId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pixelId").toString()));
}
if (!jsonObj.get("sentEmailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentEmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentEmailId").toString()));
}
if (!jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookEmailOpenedPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookEmailOpenedPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookEmailOpenedPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookEmailOpenedPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookEmailOpenedPayload>() {
@Override
public void write(JsonWriter out, WebhookEmailOpenedPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookEmailOpenedPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookEmailOpenedPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookEmailOpenedPayload
* @throws IOException if the JSON string is invalid with respect to WebhookEmailOpenedPayload
*/
public static WebhookEmailOpenedPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookEmailOpenedPayload.class);
}
/**
* Convert an instance of WebhookEmailOpenedPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.WebhookHeaders;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Representation of a webhook for an inbox. The URL specified will be using by MailSlurp whenever an email is received by the attached inbox. A webhook entity should have a URL that points to your server. Your server should accept HTTP/S POST requests and return a success 200. MailSlurp will retry your webhooks if they fail. See https://java.api.mailslurp.com/schemas/webhook-payload for the payload schema.
*/
@ApiModel(description = "Representation of a webhook for an inbox. The URL specified will be using by MailSlurp whenever an email is received by the attached inbox. A webhook entity should have a URL that points to your server. Your server should accept HTTP/S POST requests and return a success 200. MailSlurp will retry your webhooks if they fail. See https://java.api.mailslurp.com/schemas/webhook-payload for the payload schema.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth";
@SerializedName(SERIALIZED_NAME_BASIC_AUTH)
private Boolean basicAuth;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_PHONE_ID = "phoneId";
@SerializedName(SERIALIZED_NAME_PHONE_ID)
private UUID phoneId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_REQUEST_BODY_TEMPLATE = "requestBodyTemplate";
@SerializedName(SERIALIZED_NAME_REQUEST_BODY_TEMPLATE)
private String requestBodyTemplate;
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
/**
* HTTP method that your server endpoint must listen for
*/
@JsonAdapter(MethodEnum.Adapter.class)
public enum MethodEnum {
GET("GET"),
HEAD("HEAD"),
POST("POST"),
PUT("PUT"),
PATCH("PATCH"),
DELETE("DELETE"),
OPTIONS("OPTIONS"),
TRACE("TRACE");
private String value;
MethodEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static MethodEnum fromValue(String value) {
for (MethodEnum b : MethodEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<MethodEnum> {
@Override
public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public MethodEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return MethodEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_METHOD = "method";
@SerializedName(SERIALIZED_NAME_METHOD)
private MethodEnum method;
public static final String SERIALIZED_NAME_PAYLOAD_JSON_SCHEMA = "payloadJsonSchema";
@SerializedName(SERIALIZED_NAME_PAYLOAD_JSON_SCHEMA)
private String payloadJsonSchema;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
/**
* Webhook trigger event name
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_REQUEST_HEADERS = "requestHeaders";
@SerializedName(SERIALIZED_NAME_REQUEST_HEADERS)
private WebhookHeaders requestHeaders;
public static final String SERIALIZED_NAME_IGNORE_INSECURE_SSL_CERTIFICATES = "ignoreInsecureSslCertificates";
@SerializedName(SERIALIZED_NAME_IGNORE_INSECURE_SSL_CERTIFICATES)
private Boolean ignoreInsecureSslCertificates;
public static final String SERIALIZED_NAME_USE_STATIC_IP_RANGE = "useStaticIpRange";
@SerializedName(SERIALIZED_NAME_USE_STATIC_IP_RANGE)
private Boolean useStaticIpRange;
public WebhookDto() {
}
public WebhookDto id(UUID id) {
this.id = id;
return this;
}
/**
* ID of the Webhook
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the Webhook")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public WebhookDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* User ID of the Webhook
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "User ID of the Webhook")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public WebhookDto basicAuth(Boolean basicAuth) {
this.basicAuth = basicAuth;
return this;
}
/**
* Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself.
* @return basicAuth
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself.")
public Boolean getBasicAuth() {
return basicAuth;
}
public void setBasicAuth(Boolean basicAuth) {
this.basicAuth = basicAuth;
}
public WebhookDto name(String name) {
this.name = name;
return this;
}
/**
* Name of the webhook
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public WebhookDto phoneId(UUID phoneId) {
this.phoneId = phoneId;
return this;
}
/**
* The phoneNumberId that the Webhook will be triggered by. If null then webhook triggered at account level or inbox level if inboxId set
* @return phoneId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The phoneNumberId that the Webhook will be triggered by. If null then webhook triggered at account level or inbox level if inboxId set")
public UUID getPhoneId() {
return phoneId;
}
public void setPhoneId(UUID phoneId) {
this.phoneId = phoneId;
}
public WebhookDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* The inbox that the Webhook will be triggered by. If null then webhook triggered at account level or phone level if phoneId set
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The inbox that the Webhook will be triggered by. If null then webhook triggered at account level or phone level if phoneId set")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookDto requestBodyTemplate(String requestBodyTemplate) {
this.requestBodyTemplate = requestBodyTemplate;
return this;
}
/**
* Request body template for HTTP request that will be sent for the webhook. Use Moustache style template variables to insert values from the original event payload.
* @return requestBodyTemplate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Request body template for HTTP request that will be sent for the webhook. Use Moustache style template variables to insert values from the original event payload.")
public String getRequestBodyTemplate() {
return requestBodyTemplate;
}
public void setRequestBodyTemplate(String requestBodyTemplate) {
this.requestBodyTemplate = requestBodyTemplate;
}
public WebhookDto url(String url) {
this.url = url;
return this;
}
/**
* URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema.
* @return url
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema.")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public WebhookDto method(MethodEnum method) {
this.method = method;
return this;
}
/**
* HTTP method that your server endpoint must listen for
* @return method
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "HTTP method that your server endpoint must listen for")
public MethodEnum getMethod() {
return method;
}
public void setMethod(MethodEnum method) {
this.method = method;
}
public WebhookDto payloadJsonSchema(String payloadJsonSchema) {
this.payloadJsonSchema = payloadJsonSchema;
return this;
}
/**
* Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method
* @return payloadJsonSchema
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method")
public String getPayloadJsonSchema() {
return payloadJsonSchema;
}
public void setPayloadJsonSchema(String payloadJsonSchema) {
this.payloadJsonSchema = payloadJsonSchema;
}
public WebhookDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* When the webhook was created
* @return createdAt
**/
@javax.annotation.Nullable
@ApiModelProperty(required = true, value = "When the webhook was created")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public WebhookDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public WebhookDto eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Webhook trigger event name
* @return eventName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Webhook trigger event name")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookDto requestHeaders(WebhookHeaders requestHeaders) {
this.requestHeaders = requestHeaders;
return this;
}
/**
* Get requestHeaders
* @return requestHeaders
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public WebhookHeaders getRequestHeaders() {
return requestHeaders;
}
public void setRequestHeaders(WebhookHeaders requestHeaders) {
this.requestHeaders = requestHeaders;
}
public WebhookDto ignoreInsecureSslCertificates(Boolean ignoreInsecureSslCertificates) {
this.ignoreInsecureSslCertificates = ignoreInsecureSslCertificates;
return this;
}
/**
* Should notifier ignore insecure SSL certificates
* @return ignoreInsecureSslCertificates
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Should notifier ignore insecure SSL certificates")
public Boolean getIgnoreInsecureSslCertificates() {
return ignoreInsecureSslCertificates;
}
public void setIgnoreInsecureSslCertificates(Boolean ignoreInsecureSslCertificates) {
this.ignoreInsecureSslCertificates = ignoreInsecureSslCertificates;
}
public WebhookDto useStaticIpRange(Boolean useStaticIpRange) {
this.useStaticIpRange = useStaticIpRange;
return this;
}
/**
* Should notifier use static IP range when sending webhook payload
* @return useStaticIpRange
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Should notifier use static IP range when sending webhook payload")
public Boolean getUseStaticIpRange() {
return useStaticIpRange;
}
public void setUseStaticIpRange(Boolean useStaticIpRange) {
this.useStaticIpRange = useStaticIpRange;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookDto webhookDto = (WebhookDto) o;
return Objects.equals(this.id, webhookDto.id) &&
Objects.equals(this.userId, webhookDto.userId) &&
Objects.equals(this.basicAuth, webhookDto.basicAuth) &&
Objects.equals(this.name, webhookDto.name) &&
Objects.equals(this.phoneId, webhookDto.phoneId) &&
Objects.equals(this.inboxId, webhookDto.inboxId) &&
Objects.equals(this.requestBodyTemplate, webhookDto.requestBodyTemplate) &&
Objects.equals(this.url, webhookDto.url) &&
Objects.equals(this.method, webhookDto.method) &&
Objects.equals(this.payloadJsonSchema, webhookDto.payloadJsonSchema) &&
Objects.equals(this.createdAt, webhookDto.createdAt) &&
Objects.equals(this.updatedAt, webhookDto.updatedAt) &&
Objects.equals(this.eventName, webhookDto.eventName) &&
Objects.equals(this.requestHeaders, webhookDto.requestHeaders) &&
Objects.equals(this.ignoreInsecureSslCertificates, webhookDto.ignoreInsecureSslCertificates) &&
Objects.equals(this.useStaticIpRange, webhookDto.useStaticIpRange);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, basicAuth, name, phoneId, inboxId, requestBodyTemplate, url, method, payloadJsonSchema, createdAt, updatedAt, eventName, requestHeaders, ignoreInsecureSslCertificates, useStaticIpRange);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" requestBodyTemplate: ").append(toIndentedString(requestBodyTemplate)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" method: ").append(toIndentedString(method)).append("\n");
sb.append(" payloadJsonSchema: ").append(toIndentedString(payloadJsonSchema)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" requestHeaders: ").append(toIndentedString(requestHeaders)).append("\n");
sb.append(" ignoreInsecureSslCertificates: ").append(toIndentedString(ignoreInsecureSslCertificates)).append("\n");
sb.append(" useStaticIpRange: ").append(toIndentedString(useStaticIpRange)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("basicAuth");
openapiFields.add("name");
openapiFields.add("phoneId");
openapiFields.add("inboxId");
openapiFields.add("requestBodyTemplate");
openapiFields.add("url");
openapiFields.add("method");
openapiFields.add("payloadJsonSchema");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("eventName");
openapiFields.add("requestHeaders");
openapiFields.add("ignoreInsecureSslCertificates");
openapiFields.add("useStaticIpRange");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("basicAuth");
openapiRequiredFields.add("url");
openapiRequiredFields.add("method");
openapiRequiredFields.add("payloadJsonSchema");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookDto is not found in the empty JSON string", WebhookDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("phoneId") != null && !jsonObj.get("phoneId").isJsonNull()) && !jsonObj.get("phoneId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneId").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("requestBodyTemplate") != null && !jsonObj.get("requestBodyTemplate").isJsonNull()) && !jsonObj.get("requestBodyTemplate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `requestBodyTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestBodyTemplate").toString()));
}
if (!jsonObj.get("url").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString()));
}
if (!jsonObj.get("method").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString()));
}
if (!jsonObj.get("payloadJsonSchema").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `payloadJsonSchema` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payloadJsonSchema").toString()));
}
if ((jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonNull()) && !jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
// validate the optional field `requestHeaders`
if (jsonObj.get("requestHeaders") != null && !jsonObj.get("requestHeaders").isJsonNull()) {
WebhookHeaders.validateJsonObject(jsonObj.getAsJsonObject("requestHeaders"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookDto.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookDto>() {
@Override
public void write(JsonWriter out, WebhookDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookDto
* @throws IOException if the JSON string is invalid with respect to WebhookDto
*/
public static WebhookDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookDto.class);
}
/**
* Convert an instance of WebhookDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* DELIVERY_STATUS webhook payload. Sent to your webhook url endpoint via HTTP POST when an email delivery status is created. This could be a successful delivery or a delivery failure.
*/
@ApiModel(description = "DELIVERY_STATUS webhook payload. Sent to your webhook url endpoint via HTTP POST when an email delivery status is created. This could be a successful delivery or a delivery failure.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookDeliveryStatusPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_SENT_ID = "sentId";
@SerializedName(SERIALIZED_NAME_SENT_ID)
private UUID sentId;
public static final String SERIALIZED_NAME_REMOTE_MTA_IP = "remoteMtaIp";
@SerializedName(SERIALIZED_NAME_REMOTE_MTA_IP)
private String remoteMtaIp;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_REPORTING_MTA = "reportingMta";
@SerializedName(SERIALIZED_NAME_REPORTING_MTA)
private String reportingMta;
public static final String SERIALIZED_NAME_RECIPIENTS = "recipients";
@SerializedName(SERIALIZED_NAME_RECIPIENTS)
private List<String> recipients = null;
public static final String SERIALIZED_NAME_SMTP_RESPONSE = "smtpResponse";
@SerializedName(SERIALIZED_NAME_SMTP_RESPONSE)
private String smtpResponse;
public static final String SERIALIZED_NAME_SMTP_STATUS_CODE = "smtpStatusCode";
@SerializedName(SERIALIZED_NAME_SMTP_STATUS_CODE)
private Integer smtpStatusCode;
public static final String SERIALIZED_NAME_PROCESSING_TIME_MILLIS = "processingTimeMillis";
@SerializedName(SERIALIZED_NAME_PROCESSING_TIME_MILLIS)
private Long processingTimeMillis;
public static final String SERIALIZED_NAME_RECEIVED = "received";
@SerializedName(SERIALIZED_NAME_RECEIVED)
private OffsetDateTime received;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public WebhookDeliveryStatusPayload() {
}
public WebhookDeliveryStatusPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookDeliveryStatusPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookDeliveryStatusPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookDeliveryStatusPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookDeliveryStatusPayload id(UUID id) {
this.id = id;
return this;
}
/**
* ID of delivery status
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of delivery status")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public WebhookDeliveryStatusPayload userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* User ID of event
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "User ID of event")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public WebhookDeliveryStatusPayload sentId(UUID sentId) {
this.sentId = sentId;
return this;
}
/**
* ID of sent email
* @return sentId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of sent email")
public UUID getSentId() {
return sentId;
}
public void setSentId(UUID sentId) {
this.sentId = sentId;
}
public WebhookDeliveryStatusPayload remoteMtaIp(String remoteMtaIp) {
this.remoteMtaIp = remoteMtaIp;
return this;
}
/**
* IP address of the remote Mail Transfer Agent
* @return remoteMtaIp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "IP address of the remote Mail Transfer Agent")
public String getRemoteMtaIp() {
return remoteMtaIp;
}
public void setRemoteMtaIp(String remoteMtaIp) {
this.remoteMtaIp = remoteMtaIp;
}
public WebhookDeliveryStatusPayload inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Id of the inbox
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Id of the inbox")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WebhookDeliveryStatusPayload reportingMta(String reportingMta) {
this.reportingMta = reportingMta;
return this;
}
/**
* Mail Transfer Agent reporting delivery status
* @return reportingMta
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Mail Transfer Agent reporting delivery status")
public String getReportingMta() {
return reportingMta;
}
public void setReportingMta(String reportingMta) {
this.reportingMta = reportingMta;
}
public WebhookDeliveryStatusPayload recipients(List<String> recipients) {
this.recipients = recipients;
return this;
}
public WebhookDeliveryStatusPayload addRecipientsItem(String recipientsItem) {
if (this.recipients == null) {
this.recipients = new ArrayList<>();
}
this.recipients.add(recipientsItem);
return this;
}
/**
* Recipients for delivery
* @return recipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Recipients for delivery")
public List<String> getRecipients() {
return recipients;
}
public void setRecipients(List<String> recipients) {
this.recipients = recipients;
}
public WebhookDeliveryStatusPayload smtpResponse(String smtpResponse) {
this.smtpResponse = smtpResponse;
return this;
}
/**
* SMTP server response message
* @return smtpResponse
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "SMTP server response message")
public String getSmtpResponse() {
return smtpResponse;
}
public void setSmtpResponse(String smtpResponse) {
this.smtpResponse = smtpResponse;
}
public WebhookDeliveryStatusPayload smtpStatusCode(Integer smtpStatusCode) {
this.smtpStatusCode = smtpStatusCode;
return this;
}
/**
* SMTP server status
* @return smtpStatusCode
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "SMTP server status")
public Integer getSmtpStatusCode() {
return smtpStatusCode;
}
public void setSmtpStatusCode(Integer smtpStatusCode) {
this.smtpStatusCode = smtpStatusCode;
}
public WebhookDeliveryStatusPayload processingTimeMillis(Long processingTimeMillis) {
this.processingTimeMillis = processingTimeMillis;
return this;
}
/**
* Time in milliseconds for delivery processing
* @return processingTimeMillis
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Time in milliseconds for delivery processing")
public Long getProcessingTimeMillis() {
return processingTimeMillis;
}
public void setProcessingTimeMillis(Long processingTimeMillis) {
this.processingTimeMillis = processingTimeMillis;
}
public WebhookDeliveryStatusPayload received(OffsetDateTime received) {
this.received = received;
return this;
}
/**
* Time event was received
* @return received
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Time event was received")
public OffsetDateTime getReceived() {
return received;
}
public void setReceived(OffsetDateTime received) {
this.received = received;
}
public WebhookDeliveryStatusPayload subject(String subject) {
this.subject = subject;
return this;
}
/**
* Email subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email subject")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookDeliveryStatusPayload webhookDeliveryStatusPayload = (WebhookDeliveryStatusPayload) o;
return Objects.equals(this.messageId, webhookDeliveryStatusPayload.messageId) &&
Objects.equals(this.webhookId, webhookDeliveryStatusPayload.webhookId) &&
Objects.equals(this.eventName, webhookDeliveryStatusPayload.eventName) &&
Objects.equals(this.webhookName, webhookDeliveryStatusPayload.webhookName) &&
Objects.equals(this.id, webhookDeliveryStatusPayload.id) &&
Objects.equals(this.userId, webhookDeliveryStatusPayload.userId) &&
Objects.equals(this.sentId, webhookDeliveryStatusPayload.sentId) &&
Objects.equals(this.remoteMtaIp, webhookDeliveryStatusPayload.remoteMtaIp) &&
Objects.equals(this.inboxId, webhookDeliveryStatusPayload.inboxId) &&
Objects.equals(this.reportingMta, webhookDeliveryStatusPayload.reportingMta) &&
Objects.equals(this.recipients, webhookDeliveryStatusPayload.recipients) &&
Objects.equals(this.smtpResponse, webhookDeliveryStatusPayload.smtpResponse) &&
Objects.equals(this.smtpStatusCode, webhookDeliveryStatusPayload.smtpStatusCode) &&
Objects.equals(this.processingTimeMillis, webhookDeliveryStatusPayload.processingTimeMillis) &&
Objects.equals(this.received, webhookDeliveryStatusPayload.received) &&
Objects.equals(this.subject, webhookDeliveryStatusPayload.subject);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, id, userId, sentId, remoteMtaIp, inboxId, reportingMta, recipients, smtpResponse, smtpStatusCode, processingTimeMillis, received, subject);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookDeliveryStatusPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" sentId: ").append(toIndentedString(sentId)).append("\n");
sb.append(" remoteMtaIp: ").append(toIndentedString(remoteMtaIp)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" reportingMta: ").append(toIndentedString(reportingMta)).append("\n");
sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n");
sb.append(" smtpResponse: ").append(toIndentedString(smtpResponse)).append("\n");
sb.append(" smtpStatusCode: ").append(toIndentedString(smtpStatusCode)).append("\n");
sb.append(" processingTimeMillis: ").append(toIndentedString(processingTimeMillis)).append("\n");
sb.append(" received: ").append(toIndentedString(received)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("sentId");
openapiFields.add("remoteMtaIp");
openapiFields.add("inboxId");
openapiFields.add("reportingMta");
openapiFields.add("recipients");
openapiFields.add("smtpResponse");
openapiFields.add("smtpStatusCode");
openapiFields.add("processingTimeMillis");
openapiFields.add("received");
openapiFields.add("subject");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookDeliveryStatusPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookDeliveryStatusPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookDeliveryStatusPayload is not found in the empty JSON string", WebhookDeliveryStatusPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookDeliveryStatusPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookDeliveryStatusPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookDeliveryStatusPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("sentId") != null && !jsonObj.get("sentId").isJsonNull()) && !jsonObj.get("sentId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentId").toString()));
}
if ((jsonObj.get("remoteMtaIp") != null && !jsonObj.get("remoteMtaIp").isJsonNull()) && !jsonObj.get("remoteMtaIp").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `remoteMtaIp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteMtaIp").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("reportingMta") != null && !jsonObj.get("reportingMta").isJsonNull()) && !jsonObj.get("reportingMta").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `reportingMta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reportingMta").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("recipients") != null && !jsonObj.get("recipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `recipients` to be an array in the JSON string but got `%s`", jsonObj.get("recipients").toString()));
}
if ((jsonObj.get("smtpResponse") != null && !jsonObj.get("smtpResponse").isJsonNull()) && !jsonObj.get("smtpResponse").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `smtpResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpResponse").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookDeliveryStatusPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookDeliveryStatusPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookDeliveryStatusPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookDeliveryStatusPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookDeliveryStatusPayload>() {
@Override
public void write(JsonWriter out, WebhookDeliveryStatusPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookDeliveryStatusPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookDeliveryStatusPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookDeliveryStatusPayload
* @throws IOException if the JSON string is invalid with respect to WebhookDeliveryStatusPayload
*/
public static WebhookDeliveryStatusPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookDeliveryStatusPayload.class);
}
/**
* Convert an instance of WebhookDeliveryStatusPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* BOUNCE_RECIPIENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email caused a bounce to occur for a recipient. Save the recipient to a ban list of your server and avoid email them again.
*/
@ApiModel(description = "BOUNCE_RECIPIENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email caused a bounce to occur for a recipient. Save the recipient to a ban list of your server and avoid email them again.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookBounceRecipientPayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public WebhookBounceRecipientPayload() {
}
public WebhookBounceRecipientPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookBounceRecipientPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookBounceRecipientPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookBounceRecipientPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookBounceRecipientPayload recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Email address that caused a bounce. Make note of the address and try not to message it again to preserve your reputation.
* @return recipient
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Email address that caused a bounce. Make note of the address and try not to message it again to preserve your reputation.")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookBounceRecipientPayload webhookBounceRecipientPayload = (WebhookBounceRecipientPayload) o;
return Objects.equals(this.messageId, webhookBounceRecipientPayload.messageId) &&
Objects.equals(this.webhookId, webhookBounceRecipientPayload.webhookId) &&
Objects.equals(this.eventName, webhookBounceRecipientPayload.eventName) &&
Objects.equals(this.webhookName, webhookBounceRecipientPayload.webhookName) &&
Objects.equals(this.recipient, webhookBounceRecipientPayload.recipient);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, recipient);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookBounceRecipientPayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("recipient");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("recipient");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookBounceRecipientPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookBounceRecipientPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookBounceRecipientPayload is not found in the empty JSON string", WebhookBounceRecipientPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookBounceRecipientPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookBounceRecipientPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookBounceRecipientPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookBounceRecipientPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookBounceRecipientPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookBounceRecipientPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookBounceRecipientPayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookBounceRecipientPayload>() {
@Override
public void write(JsonWriter out, WebhookBounceRecipientPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookBounceRecipientPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookBounceRecipientPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookBounceRecipientPayload
* @throws IOException if the JSON string is invalid with respect to WebhookBounceRecipientPayload
*/
public static WebhookBounceRecipientPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookBounceRecipientPayload.class);
}
/**
* Convert an instance of WebhookBounceRecipientPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* BOUNCE webhook payload. Sent to your webhook url endpoint via HTTP POST when an email bounced or was rejected by a recipient. Save the recipients to a ban list on your server and avoid emailing them again. It is recommended you also listen to the BOUNCE_RECIPIENT payload.
*/
@ApiModel(description = "BOUNCE webhook payload. Sent to your webhook url endpoint via HTTP POST when an email bounced or was rejected by a recipient. Save the recipients to a ban list on your server and avoid emailing them again. It is recommended you also listen to the BOUNCE_RECIPIENT payload.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WebhookBouncePayload {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
/**
* Name of the event type webhook is being triggered for.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public static final String SERIALIZED_NAME_BOUNCE_ID = "bounceId";
@SerializedName(SERIALIZED_NAME_BOUNCE_ID)
private UUID bounceId;
public static final String SERIALIZED_NAME_SENT_TO_RECIPIENTS = "sentToRecipients";
@SerializedName(SERIALIZED_NAME_SENT_TO_RECIPIENTS)
private List<String> sentToRecipients = null;
public static final String SERIALIZED_NAME_SENDER = "sender";
@SerializedName(SERIALIZED_NAME_SENDER)
private String sender;
public static final String SERIALIZED_NAME_BOUNCE_RECIPIENTS = "bounceRecipients";
@SerializedName(SERIALIZED_NAME_BOUNCE_RECIPIENTS)
private List<String> bounceRecipients = null;
public WebhookBouncePayload() {
}
public WebhookBouncePayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Idempotent message ID. Store this ID locally or in a database to prevent message duplication.")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public WebhookBouncePayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* ID of webhook entity being triggered
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of webhook entity being triggered")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public WebhookBouncePayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Name of the event type webhook is being triggered for.
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of the event type webhook is being triggered for.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public WebhookBouncePayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Name of the webhook being triggered
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the webhook being triggered")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
public WebhookBouncePayload bounceId(UUID bounceId) {
this.bounceId = bounceId;
return this;
}
/**
* ID of the bounce email record. Use the ID with the bounce controller to view more information
* @return bounceId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the bounce email record. Use the ID with the bounce controller to view more information")
public UUID getBounceId() {
return bounceId;
}
public void setBounceId(UUID bounceId) {
this.bounceId = bounceId;
}
public WebhookBouncePayload sentToRecipients(List<String> sentToRecipients) {
this.sentToRecipients = sentToRecipients;
return this;
}
public WebhookBouncePayload addSentToRecipientsItem(String sentToRecipientsItem) {
if (this.sentToRecipients == null) {
this.sentToRecipients = new ArrayList<>();
}
this.sentToRecipients.add(sentToRecipientsItem);
return this;
}
/**
* Email sent to recipients
* @return sentToRecipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email sent to recipients")
public List<String> getSentToRecipients() {
return sentToRecipients;
}
public void setSentToRecipients(List<String> sentToRecipients) {
this.sentToRecipients = sentToRecipients;
}
public WebhookBouncePayload sender(String sender) {
this.sender = sender;
return this;
}
/**
* Sender causing bounce
* @return sender
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Sender causing bounce")
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public WebhookBouncePayload bounceRecipients(List<String> bounceRecipients) {
this.bounceRecipients = bounceRecipients;
return this;
}
public WebhookBouncePayload addBounceRecipientsItem(String bounceRecipientsItem) {
if (this.bounceRecipients == null) {
this.bounceRecipients = new ArrayList<>();
}
this.bounceRecipients.add(bounceRecipientsItem);
return this;
}
/**
* Email addresses that resulted in a bounce or email being rejected. Please save these recipients and avoid emailing them in the future to maintain your reputation.
* @return bounceRecipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email addresses that resulted in a bounce or email being rejected. Please save these recipients and avoid emailing them in the future to maintain your reputation.")
public List<String> getBounceRecipients() {
return bounceRecipients;
}
public void setBounceRecipients(List<String> bounceRecipients) {
this.bounceRecipients = bounceRecipients;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WebhookBouncePayload webhookBouncePayload = (WebhookBouncePayload) o;
return Objects.equals(this.messageId, webhookBouncePayload.messageId) &&
Objects.equals(this.webhookId, webhookBouncePayload.webhookId) &&
Objects.equals(this.eventName, webhookBouncePayload.eventName) &&
Objects.equals(this.webhookName, webhookBouncePayload.webhookName) &&
Objects.equals(this.bounceId, webhookBouncePayload.bounceId) &&
Objects.equals(this.sentToRecipients, webhookBouncePayload.sentToRecipients) &&
Objects.equals(this.sender, webhookBouncePayload.sender) &&
Objects.equals(this.bounceRecipients, webhookBouncePayload.bounceRecipients);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(messageId, webhookId, eventName, webhookName, bounceId, sentToRecipients, sender, bounceRecipients);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WebhookBouncePayload {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).append("\n");
sb.append(" bounceId: ").append(toIndentedString(bounceId)).append("\n");
sb.append(" sentToRecipients: ").append(toIndentedString(sentToRecipients)).append("\n");
sb.append(" sender: ").append(toIndentedString(sender)).append("\n");
sb.append(" bounceRecipients: ").append(toIndentedString(bounceRecipients)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("eventName");
openapiFields.add("webhookName");
openapiFields.add("bounceId");
openapiFields.add("sentToRecipients");
openapiFields.add("sender");
openapiFields.add("bounceRecipients");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("bounceId");
openapiRequiredFields.add("sender");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WebhookBouncePayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WebhookBouncePayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookBouncePayload is not found in the empty JSON string", WebhookBouncePayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WebhookBouncePayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookBouncePayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WebhookBouncePayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
if (!jsonObj.get("bounceId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bounceId").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("sentToRecipients") != null && !jsonObj.get("sentToRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `sentToRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("sentToRecipients").toString()));
}
if (!jsonObj.get("sender").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sender").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bounceRecipients") != null && !jsonObj.get("bounceRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("bounceRecipients").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WebhookBouncePayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WebhookBouncePayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WebhookBouncePayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WebhookBouncePayload.class));
return (TypeAdapter<T>) new TypeAdapter<WebhookBouncePayload>() {
@Override
public void write(JsonWriter out, WebhookBouncePayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WebhookBouncePayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WebhookBouncePayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of WebhookBouncePayload
* @throws IOException if the JSON string is invalid with respect to WebhookBouncePayload
*/
public static WebhookBouncePayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WebhookBouncePayload.class);
}
/**
* Convert an instance of WebhookBouncePayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* 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 = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
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<CountTypeEnum> {
@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<SmsMatchOption> 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<SortDirectionEnum> {
@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() {
}
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
**/
@javax.annotation.Nonnull
@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
**/
@javax.annotation.Nonnull
@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
**/
@javax.annotation.Nonnull
@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<SmsMatchOption> 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<SmsMatchOption> getMatches() {
return matches;
}
public void setMatches(List<SmsMatchOption> 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(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);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(phoneNumberId, limit, count, delayTimeout, timeout, unreadOnly, countType, matches, sortDirection, since, before);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("phoneNumberId");
openapiFields.add("limit");
openapiFields.add("count");
openapiFields.add("delayTimeout");
openapiFields.add("timeout");
openapiFields.add("unreadOnly");
openapiFields.add("countType");
openapiFields.add("matches");
openapiFields.add("sortDirection");
openapiFields.add("since");
openapiFields.add("before");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("phoneNumberId");
openapiRequiredFields.add("count");
openapiRequiredFields.add("timeout");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WaitForSmsConditions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WaitForSmsConditions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WaitForSmsConditions is not found in the empty JSON string", WaitForSmsConditions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WaitForSmsConditions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WaitForSmsConditions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WaitForSmsConditions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("phoneNumberId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberId").toString()));
}
if ((jsonObj.get("countType") != null && !jsonObj.get("countType").isJsonNull()) && !jsonObj.get("countType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `countType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countType").toString()));
}
if (jsonObj.get("matches") != null && !jsonObj.get("matches").isJsonNull()) {
JsonArray jsonArraymatches = jsonObj.getAsJsonArray("matches");
if (jsonArraymatches != null) {
// ensure the json data is an array
if (!jsonObj.get("matches").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `matches` to be an array in the JSON string but got `%s`", jsonObj.get("matches").toString()));
}
// validate the optional field `matches` (array)
for (int i = 0; i < jsonArraymatches.size(); i++) {
SmsMatchOption.validateJsonObject(jsonArraymatches.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("sortDirection") != null && !jsonObj.get("sortDirection").isJsonNull()) && !jsonObj.get("sortDirection").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sortDirection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortDirection").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WaitForSmsConditions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WaitForSmsConditions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WaitForSmsConditions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WaitForSmsConditions.class));
return (TypeAdapter<T>) new TypeAdapter<WaitForSmsConditions>() {
@Override
public void write(JsonWriter out, WaitForSmsConditions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WaitForSmsConditions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WaitForSmsConditions given an JSON string
*
* @param jsonString JSON string
* @return An instance of WaitForSmsConditions
* @throws IOException if the JSON string is invalid with respect to WaitForSmsConditions
*/
public static WaitForSmsConditions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WaitForSmsConditions.class);
}
/**
* Convert an instance of WaitForSmsConditions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* WaitForSingleSmsOptions
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WaitForSingleSmsOptions {
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_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;
public static final String SERIALIZED_NAME_BEFORE = "before";
@SerializedName(SERIALIZED_NAME_BEFORE)
private OffsetDateTime before;
public static final String SERIALIZED_NAME_SINCE = "since";
@SerializedName(SERIALIZED_NAME_SINCE)
private OffsetDateTime since;
/**
* Gets or Sets sortDirection
*/
@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<SortDirectionEnum> {
@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_DELAY = "delay";
@SerializedName(SERIALIZED_NAME_DELAY)
private Long delay;
public WaitForSingleSmsOptions() {
}
public WaitForSingleSmsOptions phoneNumberId(UUID phoneNumberId) {
this.phoneNumberId = phoneNumberId;
return this;
}
/**
* Get phoneNumberId
* @return phoneNumberId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getPhoneNumberId() {
return phoneNumberId;
}
public void setPhoneNumberId(UUID phoneNumberId) {
this.phoneNumberId = phoneNumberId;
}
public WaitForSingleSmsOptions timeout(Long timeout) {
this.timeout = timeout;
return this;
}
/**
* Get timeout
* @return timeout
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getTimeout() {
return timeout;
}
public void setTimeout(Long timeout) {
this.timeout = timeout;
}
public WaitForSingleSmsOptions unreadOnly(Boolean unreadOnly) {
this.unreadOnly = unreadOnly;
return this;
}
/**
* Get unreadOnly
* @return unreadOnly
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getUnreadOnly() {
return unreadOnly;
}
public void setUnreadOnly(Boolean unreadOnly) {
this.unreadOnly = unreadOnly;
}
public WaitForSingleSmsOptions before(OffsetDateTime before) {
this.before = before;
return this;
}
/**
* Get before
* @return before
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getBefore() {
return before;
}
public void setBefore(OffsetDateTime before) {
this.before = before;
}
public WaitForSingleSmsOptions since(OffsetDateTime since) {
this.since = since;
return this;
}
/**
* Get since
* @return since
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getSince() {
return since;
}
public void setSince(OffsetDateTime since) {
this.since = since;
}
public WaitForSingleSmsOptions sortDirection(SortDirectionEnum sortDirection) {
this.sortDirection = sortDirection;
return this;
}
/**
* Get sortDirection
* @return sortDirection
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public SortDirectionEnum getSortDirection() {
return sortDirection;
}
public void setSortDirection(SortDirectionEnum sortDirection) {
this.sortDirection = sortDirection;
}
public WaitForSingleSmsOptions delay(Long delay) {
this.delay = delay;
return this;
}
/**
* Get delay
* @return delay
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDelay() {
return delay;
}
public void setDelay(Long delay) {
this.delay = delay;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WaitForSingleSmsOptions waitForSingleSmsOptions = (WaitForSingleSmsOptions) o;
return Objects.equals(this.phoneNumberId, waitForSingleSmsOptions.phoneNumberId) &&
Objects.equals(this.timeout, waitForSingleSmsOptions.timeout) &&
Objects.equals(this.unreadOnly, waitForSingleSmsOptions.unreadOnly) &&
Objects.equals(this.before, waitForSingleSmsOptions.before) &&
Objects.equals(this.since, waitForSingleSmsOptions.since) &&
Objects.equals(this.sortDirection, waitForSingleSmsOptions.sortDirection) &&
Objects.equals(this.delay, waitForSingleSmsOptions.delay);
}
@Override
public int hashCode() {
return Objects.hash(phoneNumberId, timeout, unreadOnly, before, since, sortDirection, delay);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WaitForSingleSmsOptions {\n");
sb.append(" phoneNumberId: ").append(toIndentedString(phoneNumberId)).append("\n");
sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n");
sb.append(" unreadOnly: ").append(toIndentedString(unreadOnly)).append("\n");
sb.append(" before: ").append(toIndentedString(before)).append("\n");
sb.append(" since: ").append(toIndentedString(since)).append("\n");
sb.append(" sortDirection: ").append(toIndentedString(sortDirection)).append("\n");
sb.append(" delay: ").append(toIndentedString(delay)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("phoneNumberId");
openapiFields.add("timeout");
openapiFields.add("unreadOnly");
openapiFields.add("before");
openapiFields.add("since");
openapiFields.add("sortDirection");
openapiFields.add("delay");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("phoneNumberId");
openapiRequiredFields.add("timeout");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WaitForSingleSmsOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WaitForSingleSmsOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WaitForSingleSmsOptions is not found in the empty JSON string", WaitForSingleSmsOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WaitForSingleSmsOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WaitForSingleSmsOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WaitForSingleSmsOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("phoneNumberId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberId").toString()));
}
if ((jsonObj.get("sortDirection") != null && !jsonObj.get("sortDirection").isJsonNull()) && !jsonObj.get("sortDirection").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sortDirection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortDirection").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WaitForSingleSmsOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WaitForSingleSmsOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WaitForSingleSmsOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WaitForSingleSmsOptions.class));
return (TypeAdapter<T>) new TypeAdapter<WaitForSingleSmsOptions>() {
@Override
public void write(JsonWriter out, WaitForSingleSmsOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WaitForSingleSmsOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WaitForSingleSmsOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of WaitForSingleSmsOptions
* @throws IOException if the JSON string is invalid with respect to WaitForSingleSmsOptions
*/
public static WaitForSingleSmsOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WaitForSingleSmsOptions.class);
}
/**
* Convert an instance of WaitForSingleSmsOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.MatchOption;
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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* 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 = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class WaitForConditions {
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_COUNT = "count";
@SerializedName(SERIALIZED_NAME_COUNT)
private Integer 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<CountTypeEnum> {
@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<MatchOption> matches = null;
/**
* Direction to sort matching emails 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<SortDirectionEnum> {
@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 WaitForConditions() {
}
public WaitForConditions inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* ID of inbox to search within and apply conditions to. Essentially filtering the emails found to give a count.
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of inbox to search within and apply conditions to. Essentially filtering the emails found to give a count.")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public WaitForConditions count(Integer 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
**/
@javax.annotation.Nullable
@ApiModelProperty(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 Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public WaitForConditions 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 WaitForConditions timeout(Long timeout) {
this.timeout = timeout;
return this;
}
/**
* Max time in milliseconds to retry the `waitFor` operation until conditions are met.
* @return timeout
**/
@javax.annotation.Nonnull
@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 WaitForConditions unreadOnly(Boolean unreadOnly) {
this.unreadOnly = unreadOnly;
return this;
}
/**
* Apply conditions only to **unread** emails. All emails begin with `read=false`. An email is marked `read=true` when an `EmailDto` representation of it has been returned to the user at least once. For example you have called `getEmail` or `waitForLatestEmail` etc., or you have viewed the email in the dashboard.
* @return unreadOnly
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Apply conditions only to **unread** emails. All emails begin with `read=false`. An email is marked `read=true` when an `EmailDto` representation of it has been returned to the user at least once. For example you have called `getEmail` or `waitForLatestEmail` etc., or you have viewed the email in the dashboard.")
public Boolean getUnreadOnly() {
return unreadOnly;
}
public void setUnreadOnly(Boolean unreadOnly) {
this.unreadOnly = unreadOnly;
}
public WaitForConditions 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 WaitForConditions matches(List<MatchOption> matches) {
this.matches = matches;
return this;
}
public WaitForConditions addMatchesItem(MatchOption matchesItem) {
if (this.matches == null) {
this.matches = new ArrayList<>();
}
this.matches.add(matchesItem);
return this;
}
/**
* Conditions that should be matched for an email to qualify for results. Each condition will be applied in order to each email within an inbox to filter a result list of matching emails you are waiting for.
* @return matches
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Conditions that should be matched for an email to qualify for results. Each condition will be applied in order to each email within an inbox to filter a result list of matching emails you are waiting for.")
public List<MatchOption> getMatches() {
return matches;
}
public void setMatches(List<MatchOption> matches) {
this.matches = matches;
}
public WaitForConditions sortDirection(SortDirectionEnum sortDirection) {
this.sortDirection = sortDirection;
return this;
}
/**
* Direction to sort matching emails by created time
* @return sortDirection
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Direction to sort matching emails by created time")
public SortDirectionEnum getSortDirection() {
return sortDirection;
}
public void setSortDirection(SortDirectionEnum sortDirection) {
this.sortDirection = sortDirection;
}
public WaitForConditions since(OffsetDateTime since) {
this.since = since;
return this;
}
/**
* ISO Date Time earliest time of email to consider. Filter for matching emails that were received after this date
* @return since
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ISO Date Time earliest time of email to consider. Filter for matching emails that were received after this date")
public OffsetDateTime getSince() {
return since;
}
public void setSince(OffsetDateTime since) {
this.since = since;
}
public WaitForConditions before(OffsetDateTime before) {
this.before = before;
return this;
}
/**
* ISO Date Time latest time of email to consider. Filter for matching emails that were received before this date
* @return before
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ISO Date Time latest time of email to consider. Filter for matching emails that were received before this date")
public OffsetDateTime getBefore() {
return before;
}
public void setBefore(OffsetDateTime before) {
this.before = before;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WaitForConditions waitForConditions = (WaitForConditions) o;
return Objects.equals(this.inboxId, waitForConditions.inboxId) &&
Objects.equals(this.count, waitForConditions.count) &&
Objects.equals(this.delayTimeout, waitForConditions.delayTimeout) &&
Objects.equals(this.timeout, waitForConditions.timeout) &&
Objects.equals(this.unreadOnly, waitForConditions.unreadOnly) &&
Objects.equals(this.countType, waitForConditions.countType) &&
Objects.equals(this.matches, waitForConditions.matches) &&
Objects.equals(this.sortDirection, waitForConditions.sortDirection) &&
Objects.equals(this.since, waitForConditions.since) &&
Objects.equals(this.before, waitForConditions.before);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(inboxId, count, delayTimeout, timeout, unreadOnly, countType, matches, sortDirection, since, before);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WaitForConditions {\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxId");
openapiFields.add("count");
openapiFields.add("delayTimeout");
openapiFields.add("timeout");
openapiFields.add("unreadOnly");
openapiFields.add("countType");
openapiFields.add("matches");
openapiFields.add("sortDirection");
openapiFields.add("since");
openapiFields.add("before");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("timeout");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to WaitForConditions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!WaitForConditions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in WaitForConditions is not found in the empty JSON string", WaitForConditions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!WaitForConditions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WaitForConditions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : WaitForConditions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("countType") != null && !jsonObj.get("countType").isJsonNull()) && !jsonObj.get("countType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `countType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countType").toString()));
}
if (jsonObj.get("matches") != null && !jsonObj.get("matches").isJsonNull()) {
JsonArray jsonArraymatches = jsonObj.getAsJsonArray("matches");
if (jsonArraymatches != null) {
// ensure the json data is an array
if (!jsonObj.get("matches").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `matches` to be an array in the JSON string but got `%s`", jsonObj.get("matches").toString()));
}
// validate the optional field `matches` (array)
for (int i = 0; i < jsonArraymatches.size(); i++) {
MatchOption.validateJsonObject(jsonArraymatches.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("sortDirection") != null && !jsonObj.get("sortDirection").isJsonNull()) && !jsonObj.get("sortDirection").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sortDirection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortDirection").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!WaitForConditions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'WaitForConditions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<WaitForConditions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(WaitForConditions.class));
return (TypeAdapter<T>) new TypeAdapter<WaitForConditions>() {
@Override
public void write(JsonWriter out, WaitForConditions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public WaitForConditions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of WaitForConditions given an JSON string
*
* @param jsonString JSON string
* @return An instance of WaitForConditions
* @throws IOException if the JSON string is invalid with respect to WaitForConditions
*/
public static WaitForConditions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, WaitForConditions.class);
}
/**
* Convert an instance of WaitForConditions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* VerifyWebhookSignatureResults
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class VerifyWebhookSignatureResults {
public static final String SERIALIZED_NAME_IS_VALID = "isValid";
@SerializedName(SERIALIZED_NAME_IS_VALID)
private Boolean isValid;
public VerifyWebhookSignatureResults() {
}
public VerifyWebhookSignatureResults isValid(Boolean isValid) {
this.isValid = isValid;
return this;
}
/**
* Get isValid
* @return isValid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getIsValid() {
return isValid;
}
public void setIsValid(Boolean isValid) {
this.isValid = isValid;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
VerifyWebhookSignatureResults verifyWebhookSignatureResults = (VerifyWebhookSignatureResults) o;
return Objects.equals(this.isValid, verifyWebhookSignatureResults.isValid);
}
@Override
public int hashCode() {
return Objects.hash(isValid);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class VerifyWebhookSignatureResults {\n");
sb.append(" isValid: ").append(toIndentedString(isValid)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("isValid");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("isValid");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to VerifyWebhookSignatureResults
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!VerifyWebhookSignatureResults.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyWebhookSignatureResults is not found in the empty JSON string", VerifyWebhookSignatureResults.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!VerifyWebhookSignatureResults.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerifyWebhookSignatureResults` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : VerifyWebhookSignatureResults.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!VerifyWebhookSignatureResults.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'VerifyWebhookSignatureResults' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<VerifyWebhookSignatureResults> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(VerifyWebhookSignatureResults.class));
return (TypeAdapter<T>) new TypeAdapter<VerifyWebhookSignatureResults>() {
@Override
public void write(JsonWriter out, VerifyWebhookSignatureResults value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public VerifyWebhookSignatureResults read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of VerifyWebhookSignatureResults given an JSON string
*
* @param jsonString JSON string
* @return An instance of VerifyWebhookSignatureResults
* @throws IOException if the JSON string is invalid with respect to VerifyWebhookSignatureResults
*/
public static VerifyWebhookSignatureResults fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, VerifyWebhookSignatureResults.class);
}
/**
* Convert an instance of VerifyWebhookSignatureResults to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* VerifyWebhookSignatureOptions
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class VerifyWebhookSignatureOptions {
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_SIGNATURE = "signature";
@SerializedName(SERIALIZED_NAME_SIGNATURE)
private String signature;
public VerifyWebhookSignatureOptions() {
}
public VerifyWebhookSignatureOptions messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Get messageId
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public VerifyWebhookSignatureOptions signature(String signature) {
this.signature = signature;
return this;
}
/**
* Get signature
* @return signature
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
VerifyWebhookSignatureOptions verifyWebhookSignatureOptions = (VerifyWebhookSignatureOptions) o;
return Objects.equals(this.messageId, verifyWebhookSignatureOptions.messageId) &&
Objects.equals(this.signature, verifyWebhookSignatureOptions.signature);
}
@Override
public int hashCode() {
return Objects.hash(messageId, signature);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class VerifyWebhookSignatureOptions {\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" signature: ").append(toIndentedString(signature)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("messageId");
openapiFields.add("signature");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("signature");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to VerifyWebhookSignatureOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!VerifyWebhookSignatureOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyWebhookSignatureOptions is not found in the empty JSON string", VerifyWebhookSignatureOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!VerifyWebhookSignatureOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerifyWebhookSignatureOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : VerifyWebhookSignatureOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("signature").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!VerifyWebhookSignatureOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'VerifyWebhookSignatureOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<VerifyWebhookSignatureOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(VerifyWebhookSignatureOptions.class));
return (TypeAdapter<T>) new TypeAdapter<VerifyWebhookSignatureOptions>() {
@Override
public void write(JsonWriter out, VerifyWebhookSignatureOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public VerifyWebhookSignatureOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of VerifyWebhookSignatureOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of VerifyWebhookSignatureOptions
* @throws IOException if the JSON string is invalid with respect to VerifyWebhookSignatureOptions
*/
public static VerifyWebhookSignatureOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, VerifyWebhookSignatureOptions.class);
}
/**
* Convert an instance of VerifyWebhookSignatureOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for verifying that an email address exists at a remote mail server.
*/
@ApiModel(description = "Options for verifying that an email address exists at a remote mail server.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class VerifyEmailAddressOptions {
public static final String SERIALIZED_NAME_MAIL_SERVER_DOMAIN = "mailServerDomain";
@SerializedName(SERIALIZED_NAME_MAIL_SERVER_DOMAIN)
private String mailServerDomain;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_SENDER_EMAIL_ADDRESS = "senderEmailAddress";
@SerializedName(SERIALIZED_NAME_SENDER_EMAIL_ADDRESS)
private String senderEmailAddress;
public static final String SERIALIZED_NAME_PORT = "port";
@SerializedName(SERIALIZED_NAME_PORT)
private Integer port;
public VerifyEmailAddressOptions() {
}
public VerifyEmailAddressOptions mailServerDomain(String mailServerDomain) {
this.mailServerDomain = mailServerDomain;
return this;
}
/**
* Get mailServerDomain
* @return mailServerDomain
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMailServerDomain() {
return mailServerDomain;
}
public void setMailServerDomain(String mailServerDomain) {
this.mailServerDomain = mailServerDomain;
}
public VerifyEmailAddressOptions emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public VerifyEmailAddressOptions senderEmailAddress(String senderEmailAddress) {
this.senderEmailAddress = senderEmailAddress;
return this;
}
/**
* Get senderEmailAddress
* @return senderEmailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSenderEmailAddress() {
return senderEmailAddress;
}
public void setSenderEmailAddress(String senderEmailAddress) {
this.senderEmailAddress = senderEmailAddress;
}
public VerifyEmailAddressOptions port(Integer port) {
this.port = port;
return this;
}
/**
* Get port
* @return port
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
VerifyEmailAddressOptions verifyEmailAddressOptions = (VerifyEmailAddressOptions) o;
return Objects.equals(this.mailServerDomain, verifyEmailAddressOptions.mailServerDomain) &&
Objects.equals(this.emailAddress, verifyEmailAddressOptions.emailAddress) &&
Objects.equals(this.senderEmailAddress, verifyEmailAddressOptions.senderEmailAddress) &&
Objects.equals(this.port, verifyEmailAddressOptions.port);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(mailServerDomain, emailAddress, senderEmailAddress, port);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class VerifyEmailAddressOptions {\n");
sb.append(" mailServerDomain: ").append(toIndentedString(mailServerDomain)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" senderEmailAddress: ").append(toIndentedString(senderEmailAddress)).append("\n");
sb.append(" port: ").append(toIndentedString(port)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("mailServerDomain");
openapiFields.add("emailAddress");
openapiFields.add("senderEmailAddress");
openapiFields.add("port");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("emailAddress");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to VerifyEmailAddressOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!VerifyEmailAddressOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyEmailAddressOptions is not found in the empty JSON string", VerifyEmailAddressOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!VerifyEmailAddressOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerifyEmailAddressOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : VerifyEmailAddressOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("mailServerDomain") != null && !jsonObj.get("mailServerDomain").isJsonNull()) && !jsonObj.get("mailServerDomain").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `mailServerDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mailServerDomain").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("senderEmailAddress") != null && !jsonObj.get("senderEmailAddress").isJsonNull()) && !jsonObj.get("senderEmailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `senderEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("senderEmailAddress").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!VerifyEmailAddressOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'VerifyEmailAddressOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<VerifyEmailAddressOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(VerifyEmailAddressOptions.class));
return (TypeAdapter<T>) new TypeAdapter<VerifyEmailAddressOptions>() {
@Override
public void write(JsonWriter out, VerifyEmailAddressOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public VerifyEmailAddressOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of VerifyEmailAddressOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of VerifyEmailAddressOptions
* @throws IOException if the JSON string is invalid with respect to VerifyEmailAddressOptions
*/
public static VerifyEmailAddressOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, VerifyEmailAddressOptions.class);
}
/**
* Convert an instance of VerifyEmailAddressOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Optional warnings resulting from HTML validation
*/
@ApiModel(description = "Optional warnings resulting from HTML validation")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ValidationMessage {
public static final String SERIALIZED_NAME_LINE_NUMBER = "lineNumber";
@SerializedName(SERIALIZED_NAME_LINE_NUMBER)
private Integer lineNumber;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public ValidationMessage() {
}
public ValidationMessage lineNumber(Integer lineNumber) {
this.lineNumber = lineNumber;
return this;
}
/**
* Get lineNumber
* @return lineNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Integer getLineNumber() {
return lineNumber;
}
public void setLineNumber(Integer lineNumber) {
this.lineNumber = lineNumber;
}
public ValidationMessage message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ValidationMessage validationMessage = (ValidationMessage) o;
return Objects.equals(this.lineNumber, validationMessage.lineNumber) &&
Objects.equals(this.message, validationMessage.message);
}
@Override
public int hashCode() {
return Objects.hash(lineNumber, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ValidationMessage {\n");
sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("lineNumber");
openapiFields.add("message");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("lineNumber");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ValidationMessage
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ValidationMessage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationMessage is not found in the empty JSON string", ValidationMessage.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ValidationMessage.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationMessage` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ValidationMessage.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ValidationMessage.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ValidationMessage' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ValidationMessage> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ValidationMessage.class));
return (TypeAdapter<T>) new TypeAdapter<ValidationMessage>() {
@Override
public void write(JsonWriter out, ValidationMessage value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ValidationMessage read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ValidationMessage given an JSON string
*
* @param jsonString JSON string
* @return An instance of ValidationMessage
* @throws IOException if the JSON string is invalid with respect to ValidationMessage
*/
public static ValidationMessage fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ValidationMessage.class);
}
/**
* Convert an instance of ValidationMessage to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.HTMLValidationResult;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Response object for email validation operation
*/
@ApiModel(description = "Response object for email validation operation")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ValidationDto {
public static final String SERIALIZED_NAME_EMAIL_ID = "emailId";
@SerializedName(SERIALIZED_NAME_EMAIL_ID)
private UUID emailId;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private HTMLValidationResult html;
public ValidationDto() {
}
public ValidationDto emailId(UUID emailId) {
this.emailId = emailId;
return this;
}
/**
* ID of the email validated
* @return emailId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the email validated")
public UUID getEmailId() {
return emailId;
}
public void setEmailId(UUID emailId) {
this.emailId = emailId;
}
public ValidationDto html(HTMLValidationResult html) {
this.html = html;
return this;
}
/**
* Get html
* @return html
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public HTMLValidationResult getHtml() {
return html;
}
public void setHtml(HTMLValidationResult html) {
this.html = html;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ValidationDto validationDto = (ValidationDto) o;
return Objects.equals(this.emailId, validationDto.emailId) &&
Objects.equals(this.html, validationDto.html);
}
@Override
public int hashCode() {
return Objects.hash(emailId, html);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ValidationDto {\n");
sb.append(" emailId: ").append(toIndentedString(emailId)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("emailId");
openapiFields.add("html");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("emailId");
openapiRequiredFields.add("html");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ValidationDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ValidationDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationDto is not found in the empty JSON string", ValidationDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ValidationDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ValidationDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("emailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailId").toString()));
}
// validate the required field `html`
HTMLValidationResult.validateJsonObject(jsonObj.getAsJsonObject("html"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ValidationDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ValidationDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ValidationDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ValidationDto.class));
return (TypeAdapter<T>) new TypeAdapter<ValidationDto>() {
@Override
public void write(JsonWriter out, ValidationDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ValidationDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ValidationDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of ValidationDto
* @throws IOException if the JSON string is invalid with respect to ValidationDto
*/
public static ValidationDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ValidationDto.class);
}
/**
* Convert an instance of ValidationDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of validating a list of email addresses
*/
@ApiModel(description = "Result of validating a list of email addresses")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ValidateEmailAddressListResult {
public static final String SERIALIZED_NAME_VALID_EMAIL_ADDRESSES = "validEmailAddresses";
@SerializedName(SERIALIZED_NAME_VALID_EMAIL_ADDRESSES)
private List<String> validEmailAddresses = new ArrayList<>();
public static final String SERIALIZED_NAME_INVALID_EMAIL_ADDRESSES = "invalidEmailAddresses";
@SerializedName(SERIALIZED_NAME_INVALID_EMAIL_ADDRESSES)
private List<String> invalidEmailAddresses = new ArrayList<>();
public static final String SERIALIZED_NAME_RESULT_MAP_EMAIL_ADDRESS_IS_VALID = "resultMapEmailAddressIsValid";
@SerializedName(SERIALIZED_NAME_RESULT_MAP_EMAIL_ADDRESS_IS_VALID)
private Map<String, Boolean> resultMapEmailAddressIsValid = new HashMap<>();
public ValidateEmailAddressListResult() {
}
public ValidateEmailAddressListResult validEmailAddresses(List<String> validEmailAddresses) {
this.validEmailAddresses = validEmailAddresses;
return this;
}
public ValidateEmailAddressListResult addValidEmailAddressesItem(String validEmailAddressesItem) {
this.validEmailAddresses.add(validEmailAddressesItem);
return this;
}
/**
* Get validEmailAddresses
* @return validEmailAddresses
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getValidEmailAddresses() {
return validEmailAddresses;
}
public void setValidEmailAddresses(List<String> validEmailAddresses) {
this.validEmailAddresses = validEmailAddresses;
}
public ValidateEmailAddressListResult invalidEmailAddresses(List<String> invalidEmailAddresses) {
this.invalidEmailAddresses = invalidEmailAddresses;
return this;
}
public ValidateEmailAddressListResult addInvalidEmailAddressesItem(String invalidEmailAddressesItem) {
this.invalidEmailAddresses.add(invalidEmailAddressesItem);
return this;
}
/**
* Get invalidEmailAddresses
* @return invalidEmailAddresses
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getInvalidEmailAddresses() {
return invalidEmailAddresses;
}
public void setInvalidEmailAddresses(List<String> invalidEmailAddresses) {
this.invalidEmailAddresses = invalidEmailAddresses;
}
public ValidateEmailAddressListResult resultMapEmailAddressIsValid(Map<String, Boolean> resultMapEmailAddressIsValid) {
this.resultMapEmailAddressIsValid = resultMapEmailAddressIsValid;
return this;
}
public ValidateEmailAddressListResult putResultMapEmailAddressIsValidItem(String key, Boolean resultMapEmailAddressIsValidItem) {
this.resultMapEmailAddressIsValid.put(key, resultMapEmailAddressIsValidItem);
return this;
}
/**
* Get resultMapEmailAddressIsValid
* @return resultMapEmailAddressIsValid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Map<String, Boolean> getResultMapEmailAddressIsValid() {
return resultMapEmailAddressIsValid;
}
public void setResultMapEmailAddressIsValid(Map<String, Boolean> resultMapEmailAddressIsValid) {
this.resultMapEmailAddressIsValid = resultMapEmailAddressIsValid;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ValidateEmailAddressListResult validateEmailAddressListResult = (ValidateEmailAddressListResult) o;
return Objects.equals(this.validEmailAddresses, validateEmailAddressListResult.validEmailAddresses) &&
Objects.equals(this.invalidEmailAddresses, validateEmailAddressListResult.invalidEmailAddresses) &&
Objects.equals(this.resultMapEmailAddressIsValid, validateEmailAddressListResult.resultMapEmailAddressIsValid);
}
@Override
public int hashCode() {
return Objects.hash(validEmailAddresses, invalidEmailAddresses, resultMapEmailAddressIsValid);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ValidateEmailAddressListResult {\n");
sb.append(" validEmailAddresses: ").append(toIndentedString(validEmailAddresses)).append("\n");
sb.append(" invalidEmailAddresses: ").append(toIndentedString(invalidEmailAddresses)).append("\n");
sb.append(" resultMapEmailAddressIsValid: ").append(toIndentedString(resultMapEmailAddressIsValid)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("validEmailAddresses");
openapiFields.add("invalidEmailAddresses");
openapiFields.add("resultMapEmailAddressIsValid");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("validEmailAddresses");
openapiRequiredFields.add("invalidEmailAddresses");
openapiRequiredFields.add("resultMapEmailAddressIsValid");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ValidateEmailAddressListResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ValidateEmailAddressListResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ValidateEmailAddressListResult is not found in the empty JSON string", ValidateEmailAddressListResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ValidateEmailAddressListResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidateEmailAddressListResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ValidateEmailAddressListResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("validEmailAddresses") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("validEmailAddresses").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `validEmailAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("validEmailAddresses").toString()));
}
// ensure the required json array is present
if (jsonObj.get("invalidEmailAddresses") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("invalidEmailAddresses").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `invalidEmailAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("invalidEmailAddresses").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ValidateEmailAddressListResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ValidateEmailAddressListResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ValidateEmailAddressListResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ValidateEmailAddressListResult.class));
return (TypeAdapter<T>) new TypeAdapter<ValidateEmailAddressListResult>() {
@Override
public void write(JsonWriter out, ValidateEmailAddressListResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ValidateEmailAddressListResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ValidateEmailAddressListResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of ValidateEmailAddressListResult
* @throws IOException if the JSON string is invalid with respect to ValidateEmailAddressListResult
*/
public static ValidateEmailAddressListResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ValidateEmailAddressListResult.class);
}
/**
* Convert an instance of ValidateEmailAddressListResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for validating a list of email addresses
*/
@ApiModel(description = "Options for validating a list of email addresses")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ValidateEmailAddressListOptions {
public static final String SERIALIZED_NAME_EMAIL_ADDRESS_LIST = "emailAddressList";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS_LIST)
private List<String> emailAddressList = new ArrayList<>();
public ValidateEmailAddressListOptions() {
}
public ValidateEmailAddressListOptions emailAddressList(List<String> emailAddressList) {
this.emailAddressList = emailAddressList;
return this;
}
public ValidateEmailAddressListOptions addEmailAddressListItem(String emailAddressListItem) {
this.emailAddressList.add(emailAddressListItem);
return this;
}
/**
* Get emailAddressList
* @return emailAddressList
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getEmailAddressList() {
return emailAddressList;
}
public void setEmailAddressList(List<String> emailAddressList) {
this.emailAddressList = emailAddressList;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ValidateEmailAddressListOptions validateEmailAddressListOptions = (ValidateEmailAddressListOptions) o;
return Objects.equals(this.emailAddressList, validateEmailAddressListOptions.emailAddressList);
}
@Override
public int hashCode() {
return Objects.hash(emailAddressList);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ValidateEmailAddressListOptions {\n");
sb.append(" emailAddressList: ").append(toIndentedString(emailAddressList)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("emailAddressList");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("emailAddressList");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ValidateEmailAddressListOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ValidateEmailAddressListOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ValidateEmailAddressListOptions is not found in the empty JSON string", ValidateEmailAddressListOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ValidateEmailAddressListOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidateEmailAddressListOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ValidateEmailAddressListOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("emailAddressList") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("emailAddressList").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddressList` to be an array in the JSON string but got `%s`", jsonObj.get("emailAddressList").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ValidateEmailAddressListOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ValidateEmailAddressListOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ValidateEmailAddressListOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ValidateEmailAddressListOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ValidateEmailAddressListOptions>() {
@Override
public void write(JsonWriter out, ValidateEmailAddressListOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ValidateEmailAddressListOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ValidateEmailAddressListOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ValidateEmailAddressListOptions
* @throws IOException if the JSON string is invalid with respect to ValidateEmailAddressListOptions
*/
public static ValidateEmailAddressListOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ValidateEmailAddressListOptions.class);
}
/**
* Convert an instance of ValidateEmailAddressListOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* UserInfoDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UserInfoDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
/**
* Gets or Sets accountState
*/
@JsonAdapter(AccountStateEnum.Adapter.class)
public enum AccountStateEnum {
FROZEN("FROZEN"),
ACTIVE("ACTIVE");
private String value;
AccountStateEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static AccountStateEnum fromValue(String value) {
for (AccountStateEnum b : AccountStateEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<AccountStateEnum> {
@Override
public void write(final JsonWriter jsonWriter, final AccountStateEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public AccountStateEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return AccountStateEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ACCOUNT_STATE = "accountState";
@SerializedName(SERIALIZED_NAME_ACCOUNT_STATE)
private AccountStateEnum accountState;
/**
* Gets or Sets subscriptionType
*/
@JsonAdapter(SubscriptionTypeEnum.Adapter.class)
public enum SubscriptionTypeEnum {
PRO_MONTHLY("PRO_MONTHLY"),
STARTER("STARTER"),
TEAM("TEAM"),
ENTERPRISE("ENTERPRISE");
private String value;
SubscriptionTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SubscriptionTypeEnum fromValue(String value) {
for (SubscriptionTypeEnum b : SubscriptionTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SubscriptionTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SubscriptionTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SubscriptionTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SubscriptionTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SUBSCRIPTION_TYPE = "subscriptionType";
@SerializedName(SERIALIZED_NAME_SUBSCRIPTION_TYPE)
private SubscriptionTypeEnum subscriptionType;
/**
* Gets or Sets accountType
*/
@JsonAdapter(AccountTypeEnum.Adapter.class)
public enum AccountTypeEnum {
SOLO("SOLO"),
CHILD_SOLO("CHILD_SOLO"),
CHILD_TEAM("CHILD_TEAM"),
CHILD_ADMIN("CHILD_ADMIN");
private String value;
AccountTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static AccountTypeEnum fromValue(String value) {
for (AccountTypeEnum b : AccountTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<AccountTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final AccountTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public AccountTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return AccountTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType";
@SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE)
private AccountTypeEnum accountType;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public UserInfoDto() {
}
public UserInfoDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public UserInfoDto emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public UserInfoDto accountState(AccountStateEnum accountState) {
this.accountState = accountState;
return this;
}
/**
* Get accountState
* @return accountState
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public AccountStateEnum getAccountState() {
return accountState;
}
public void setAccountState(AccountStateEnum accountState) {
this.accountState = accountState;
}
public UserInfoDto subscriptionType(SubscriptionTypeEnum subscriptionType) {
this.subscriptionType = subscriptionType;
return this;
}
/**
* Get subscriptionType
* @return subscriptionType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public SubscriptionTypeEnum getSubscriptionType() {
return subscriptionType;
}
public void setSubscriptionType(SubscriptionTypeEnum subscriptionType) {
this.subscriptionType = subscriptionType;
}
public UserInfoDto accountType(AccountTypeEnum accountType) {
this.accountType = accountType;
return this;
}
/**
* Get accountType
* @return accountType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public AccountTypeEnum getAccountType() {
return accountType;
}
public void setAccountType(AccountTypeEnum accountType) {
this.accountType = accountType;
}
public UserInfoDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UserInfoDto userInfoDto = (UserInfoDto) o;
return Objects.equals(this.id, userInfoDto.id) &&
Objects.equals(this.emailAddress, userInfoDto.emailAddress) &&
Objects.equals(this.accountState, userInfoDto.accountState) &&
Objects.equals(this.subscriptionType, userInfoDto.subscriptionType) &&
Objects.equals(this.accountType, userInfoDto.accountType) &&
Objects.equals(this.createdAt, userInfoDto.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, emailAddress, accountState, subscriptionType, accountType, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UserInfoDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" accountState: ").append(toIndentedString(accountState)).append("\n");
sb.append(" subscriptionType: ").append(toIndentedString(subscriptionType)).append("\n");
sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("emailAddress");
openapiFields.add("accountState");
openapiFields.add("subscriptionType");
openapiFields.add("accountType");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("accountState");
openapiRequiredFields.add("accountType");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UserInfoDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UserInfoDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UserInfoDto is not found in the empty JSON string", UserInfoDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UserInfoDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserInfoDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UserInfoDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if (!jsonObj.get("accountState").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accountState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountState").toString()));
}
if ((jsonObj.get("subscriptionType") != null && !jsonObj.get("subscriptionType").isJsonNull()) && !jsonObj.get("subscriptionType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subscriptionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionType").toString()));
}
if (!jsonObj.get("accountType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UserInfoDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UserInfoDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UserInfoDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UserInfoDto.class));
return (TypeAdapter<T>) new TypeAdapter<UserInfoDto>() {
@Override
public void write(JsonWriter out, UserInfoDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UserInfoDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UserInfoDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of UserInfoDto
* @throws IOException if the JSON string is invalid with respect to UserInfoDto
*/
public static UserInfoDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UserInfoDto.class);
}
/**
* Convert an instance of UserInfoDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.File;
import java.io.IOException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* UploadMultipartFormRequest
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UploadMultipartFormRequest {
public static final String SERIALIZED_NAME_CONTENT_TYPE_HEADER = "contentTypeHeader";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE_HEADER)
private String contentTypeHeader;
public static final String SERIALIZED_NAME_FILE = "file";
@SerializedName(SERIALIZED_NAME_FILE)
private File _file;
public UploadMultipartFormRequest() {
}
public UploadMultipartFormRequest contentTypeHeader(String contentTypeHeader) {
this.contentTypeHeader = contentTypeHeader;
return this;
}
/**
* Optional content type header of attachment
* @return contentTypeHeader
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional content type header of attachment")
public String getContentTypeHeader() {
return contentTypeHeader;
}
public void setContentTypeHeader(String contentTypeHeader) {
this.contentTypeHeader = contentTypeHeader;
}
public UploadMultipartFormRequest _file(File _file) {
this._file = _file;
return this;
}
/**
* Get _file
* @return _file
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public File getFile() {
return _file;
}
public void setFile(File _file) {
this._file = _file;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UploadMultipartFormRequest uploadMultipartFormRequest = (UploadMultipartFormRequest) o;
return Objects.equals(this.contentTypeHeader, uploadMultipartFormRequest.contentTypeHeader) &&
Objects.equals(this._file, uploadMultipartFormRequest._file);
}
@Override
public int hashCode() {
return Objects.hash(contentTypeHeader, _file);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UploadMultipartFormRequest {\n");
sb.append(" contentTypeHeader: ").append(toIndentedString(contentTypeHeader)).append("\n");
sb.append(" _file: ").append(toIndentedString(_file)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("contentTypeHeader");
openapiFields.add("file");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("file");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UploadMultipartFormRequest
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UploadMultipartFormRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UploadMultipartFormRequest is not found in the empty JSON string", UploadMultipartFormRequest.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UploadMultipartFormRequest.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UploadMultipartFormRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UploadMultipartFormRequest.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("contentTypeHeader") != null && !jsonObj.get("contentTypeHeader").isJsonNull()) && !jsonObj.get("contentTypeHeader").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentTypeHeader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentTypeHeader").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UploadMultipartFormRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UploadMultipartFormRequest' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UploadMultipartFormRequest> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UploadMultipartFormRequest.class));
return (TypeAdapter<T>) new TypeAdapter<UploadMultipartFormRequest>() {
@Override
public void write(JsonWriter out, UploadMultipartFormRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UploadMultipartFormRequest read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UploadMultipartFormRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of UploadMultipartFormRequest
* @throws IOException if the JSON string is invalid with respect to UploadMultipartFormRequest
*/
public static UploadMultipartFormRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UploadMultipartFormRequest.class);
}
/**
* Convert an instance of UploadMultipartFormRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for uploading files for attachments. When sending emails with the API that require attachments first upload each attachment. Then use the returned attachment ID in your `SendEmailOptions` when sending an email. This way you can use attachments multiple times once they have been uploaded.
*/
@ApiModel(description = "Options for uploading files for attachments. When sending emails with the API that require attachments first upload each attachment. Then use the returned attachment ID in your `SendEmailOptions` when sending an email. This way you can use attachments multiple times once they have been uploaded.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UploadAttachmentOptions {
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public static final String SERIALIZED_NAME_FILENAME = "filename";
@SerializedName(SERIALIZED_NAME_FILENAME)
private String filename;
public static final String SERIALIZED_NAME_BASE64_CONTENTS = "base64Contents";
@SerializedName(SERIALIZED_NAME_BASE64_CONTENTS)
private String base64Contents;
public UploadAttachmentOptions() {
}
public UploadAttachmentOptions contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Optional contentType for file. For instance `application/pdf`
* @return contentType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional contentType for file. For instance `application/pdf`")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public UploadAttachmentOptions filename(String filename) {
this.filename = filename;
return this;
}
/**
* Optional filename to save upload with. Will be the name that is shown in email clients
* @return filename
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional filename to save upload with. Will be the name that is shown in email clients")
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public UploadAttachmentOptions base64Contents(String base64Contents) {
this.base64Contents = base64Contents;
return this;
}
/**
* Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/
* @return base64Contents
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/")
public String getBase64Contents() {
return base64Contents;
}
public void setBase64Contents(String base64Contents) {
this.base64Contents = base64Contents;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UploadAttachmentOptions uploadAttachmentOptions = (UploadAttachmentOptions) o;
return Objects.equals(this.contentType, uploadAttachmentOptions.contentType) &&
Objects.equals(this.filename, uploadAttachmentOptions.filename) &&
Objects.equals(this.base64Contents, uploadAttachmentOptions.base64Contents);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(contentType, filename, base64Contents);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UploadAttachmentOptions {\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
sb.append(" filename: ").append(toIndentedString(filename)).append("\n");
sb.append(" base64Contents: ").append(toIndentedString(base64Contents)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("contentType");
openapiFields.add("filename");
openapiFields.add("base64Contents");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("base64Contents");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UploadAttachmentOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UploadAttachmentOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UploadAttachmentOptions is not found in the empty JSON string", UploadAttachmentOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UploadAttachmentOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UploadAttachmentOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UploadAttachmentOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("contentType") != null && !jsonObj.get("contentType").isJsonNull()) && !jsonObj.get("contentType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString()));
}
if ((jsonObj.get("filename") != null && !jsonObj.get("filename").isJsonNull()) && !jsonObj.get("filename").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString()));
}
if (!jsonObj.get("base64Contents").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `base64Contents` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64Contents").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UploadAttachmentOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UploadAttachmentOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UploadAttachmentOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UploadAttachmentOptions.class));
return (TypeAdapter<T>) new TypeAdapter<UploadAttachmentOptions>() {
@Override
public void write(JsonWriter out, UploadAttachmentOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UploadAttachmentOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UploadAttachmentOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of UploadAttachmentOptions
* @throws IOException if the JSON string is invalid with respect to UploadAttachmentOptions
*/
public static UploadAttachmentOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UploadAttachmentOptions.class);
}
/**
* Convert an instance of UploadAttachmentOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Byte array request body
*/
@ApiModel(description = "Byte array request body")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UploadAttachmentBytesRequest {
public static final String SERIALIZED_NAME_SHORT = "short";
@SerializedName(SERIALIZED_NAME_SHORT)
private Integer _short;
public static final String SERIALIZED_NAME_CHAR = "char";
@SerializedName(SERIALIZED_NAME_CHAR)
private String _char;
public static final String SERIALIZED_NAME_INT = "int";
@SerializedName(SERIALIZED_NAME_INT)
private Integer _int;
public static final String SERIALIZED_NAME_LONG = "long";
@SerializedName(SERIALIZED_NAME_LONG)
private Long _long;
public static final String SERIALIZED_NAME_FLOAT = "float";
@SerializedName(SERIALIZED_NAME_FLOAT)
private Float _float;
public static final String SERIALIZED_NAME_DOUBLE = "double";
@SerializedName(SERIALIZED_NAME_DOUBLE)
private Double _double;
public static final String SERIALIZED_NAME_DIRECT = "direct";
@SerializedName(SERIALIZED_NAME_DIRECT)
private Boolean direct;
public static final String SERIALIZED_NAME_READ_ONLY = "readOnly";
@SerializedName(SERIALIZED_NAME_READ_ONLY)
private Boolean readOnly;
public UploadAttachmentBytesRequest() {
}
public UploadAttachmentBytesRequest _short(Integer _short) {
this._short = _short;
return this;
}
/**
* Get _short
* @return _short
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getShort() {
return _short;
}
public void setShort(Integer _short) {
this._short = _short;
}
public UploadAttachmentBytesRequest _char(String _char) {
this._char = _char;
return this;
}
/**
* Get _char
* @return _char
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getChar() {
return _char;
}
public void setChar(String _char) {
this._char = _char;
}
public UploadAttachmentBytesRequest _int(Integer _int) {
this._int = _int;
return this;
}
/**
* Get _int
* @return _int
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getInt() {
return _int;
}
public void setInt(Integer _int) {
this._int = _int;
}
public UploadAttachmentBytesRequest _long(Long _long) {
this._long = _long;
return this;
}
/**
* Get _long
* @return _long
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getLong() {
return _long;
}
public void setLong(Long _long) {
this._long = _long;
}
public UploadAttachmentBytesRequest _float(Float _float) {
this._float = _float;
return this;
}
/**
* Get _float
* @return _float
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Float getFloat() {
return _float;
}
public void setFloat(Float _float) {
this._float = _float;
}
public UploadAttachmentBytesRequest _double(Double _double) {
this._double = _double;
return this;
}
/**
* Get _double
* @return _double
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Double getDouble() {
return _double;
}
public void setDouble(Double _double) {
this._double = _double;
}
public UploadAttachmentBytesRequest direct(Boolean direct) {
this.direct = direct;
return this;
}
/**
* Get direct
* @return direct
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getDirect() {
return direct;
}
public void setDirect(Boolean direct) {
this.direct = direct;
}
public UploadAttachmentBytesRequest readOnly(Boolean readOnly) {
this.readOnly = readOnly;
return this;
}
/**
* Get readOnly
* @return readOnly
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getReadOnly() {
return readOnly;
}
public void setReadOnly(Boolean readOnly) {
this.readOnly = readOnly;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UploadAttachmentBytesRequest uploadAttachmentBytesRequest = (UploadAttachmentBytesRequest) o;
return Objects.equals(this._short, uploadAttachmentBytesRequest._short) &&
Objects.equals(this._char, uploadAttachmentBytesRequest._char) &&
Objects.equals(this._int, uploadAttachmentBytesRequest._int) &&
Objects.equals(this._long, uploadAttachmentBytesRequest._long) &&
Objects.equals(this._float, uploadAttachmentBytesRequest._float) &&
Objects.equals(this._double, uploadAttachmentBytesRequest._double) &&
Objects.equals(this.direct, uploadAttachmentBytesRequest.direct) &&
Objects.equals(this.readOnly, uploadAttachmentBytesRequest.readOnly);
}
@Override
public int hashCode() {
return Objects.hash(_short, _char, _int, _long, _float, _double, direct, readOnly);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UploadAttachmentBytesRequest {\n");
sb.append(" _short: ").append(toIndentedString(_short)).append("\n");
sb.append(" _char: ").append(toIndentedString(_char)).append("\n");
sb.append(" _int: ").append(toIndentedString(_int)).append("\n");
sb.append(" _long: ").append(toIndentedString(_long)).append("\n");
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
sb.append(" direct: ").append(toIndentedString(direct)).append("\n");
sb.append(" readOnly: ").append(toIndentedString(readOnly)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("short");
openapiFields.add("char");
openapiFields.add("int");
openapiFields.add("long");
openapiFields.add("float");
openapiFields.add("double");
openapiFields.add("direct");
openapiFields.add("readOnly");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UploadAttachmentBytesRequest
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UploadAttachmentBytesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UploadAttachmentBytesRequest is not found in the empty JSON string", UploadAttachmentBytesRequest.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UploadAttachmentBytesRequest.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UploadAttachmentBytesRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("char") != null && !jsonObj.get("char").isJsonNull()) && !jsonObj.get("char").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `char` to be a primitive type in the JSON string but got `%s`", jsonObj.get("char").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UploadAttachmentBytesRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UploadAttachmentBytesRequest' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UploadAttachmentBytesRequest> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UploadAttachmentBytesRequest.class));
return (TypeAdapter<T>) new TypeAdapter<UploadAttachmentBytesRequest>() {
@Override
public void write(JsonWriter out, UploadAttachmentBytesRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UploadAttachmentBytesRequest read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UploadAttachmentBytesRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of UploadAttachmentBytesRequest
* @throws IOException if the JSON string is invalid with respect to UploadAttachmentBytesRequest
*/
public static UploadAttachmentBytesRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UploadAttachmentBytesRequest.class);
}
/**
* Convert an instance of UploadAttachmentBytesRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for updating an inbox replier
*/
@ApiModel(description = "Options for updating an inbox replier")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UpdateInboxReplierOptions {
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* Field to match against to trigger inbox replier for inbound email
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
RECIPIENTS("RECIPIENTS"),
SENDER("SENDER"),
SUBJECT("SUBJECT"),
ATTACHMENTS("ATTACHMENTS");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
public static final String SERIALIZED_NAME_MATCH = "match";
@SerializedName(SERIALIZED_NAME_MATCH)
private String match;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_IGNORE_REPLY_TO = "ignoreReplyTo";
@SerializedName(SERIALIZED_NAME_IGNORE_REPLY_TO)
private Boolean ignoreReplyTo;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_TEMPLATE_ID = "templateId";
@SerializedName(SERIALIZED_NAME_TEMPLATE_ID)
private UUID templateId;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public UpdateInboxReplierOptions() {
}
public UpdateInboxReplierOptions inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Inbox ID to attach replier to
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inbox ID to attach replier to")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public UpdateInboxReplierOptions name(String name) {
this.name = name;
return this;
}
/**
* Name for replier
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name for replier")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public UpdateInboxReplierOptions field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Field to match against to trigger inbox replier for inbound email
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Field to match against to trigger inbox replier for inbound email")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public UpdateInboxReplierOptions match(String match) {
this.match = match;
return this;
}
/**
* String or wildcard style match for field specified when evaluating reply rules
* @return match
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "String or wildcard style match for field specified when evaluating reply rules")
public String getMatch() {
return match;
}
public void setMatch(String match) {
this.match = match;
}
public UpdateInboxReplierOptions replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* Reply-to email address when sending replying
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Reply-to email address when sending replying")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public UpdateInboxReplierOptions subject(String subject) {
this.subject = subject;
return this;
}
/**
* Subject override when replying to email
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Subject override when replying to email")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public UpdateInboxReplierOptions from(String from) {
this.from = from;
return this;
}
/**
* Send email from address
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Send email from address")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public UpdateInboxReplierOptions charset(String charset) {
this.charset = charset;
return this;
}
/**
* Email reply charset
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email reply charset")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public UpdateInboxReplierOptions isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Send HTML email
* @return isHTML
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Send HTML email")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public UpdateInboxReplierOptions ignoreReplyTo(Boolean ignoreReplyTo) {
this.ignoreReplyTo = ignoreReplyTo;
return this;
}
/**
* Ignore sender replyTo when responding. Send directly to the sender if enabled.
* @return ignoreReplyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Ignore sender replyTo when responding. Send directly to the sender if enabled.")
public Boolean getIgnoreReplyTo() {
return ignoreReplyTo;
}
public void setIgnoreReplyTo(Boolean ignoreReplyTo) {
this.ignoreReplyTo = ignoreReplyTo;
}
public UpdateInboxReplierOptions body(String body) {
this.body = body;
return this;
}
/**
* Email body for reply
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email body for reply")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public UpdateInboxReplierOptions templateId(UUID templateId) {
this.templateId = templateId;
return this;
}
/**
* ID of template to use when sending a reply
* @return templateId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of template to use when sending a reply")
public UUID getTemplateId() {
return templateId;
}
public void setTemplateId(UUID templateId) {
this.templateId = templateId;
}
public UpdateInboxReplierOptions templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public UpdateInboxReplierOptions putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Template variable values
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template variable values")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateInboxReplierOptions updateInboxReplierOptions = (UpdateInboxReplierOptions) o;
return Objects.equals(this.inboxId, updateInboxReplierOptions.inboxId) &&
Objects.equals(this.name, updateInboxReplierOptions.name) &&
Objects.equals(this.field, updateInboxReplierOptions.field) &&
Objects.equals(this.match, updateInboxReplierOptions.match) &&
Objects.equals(this.replyTo, updateInboxReplierOptions.replyTo) &&
Objects.equals(this.subject, updateInboxReplierOptions.subject) &&
Objects.equals(this.from, updateInboxReplierOptions.from) &&
Objects.equals(this.charset, updateInboxReplierOptions.charset) &&
Objects.equals(this.isHTML, updateInboxReplierOptions.isHTML) &&
Objects.equals(this.ignoreReplyTo, updateInboxReplierOptions.ignoreReplyTo) &&
Objects.equals(this.body, updateInboxReplierOptions.body) &&
Objects.equals(this.templateId, updateInboxReplierOptions.templateId) &&
Objects.equals(this.templateVariables, updateInboxReplierOptions.templateVariables);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(inboxId, name, field, match, replyTo, subject, from, charset, isHTML, ignoreReplyTo, body, templateId, templateVariables);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateInboxReplierOptions {\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" match: ").append(toIndentedString(match)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" ignoreReplyTo: ").append(toIndentedString(ignoreReplyTo)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxId");
openapiFields.add("name");
openapiFields.add("field");
openapiFields.add("match");
openapiFields.add("replyTo");
openapiFields.add("subject");
openapiFields.add("from");
openapiFields.add("charset");
openapiFields.add("isHTML");
openapiFields.add("ignoreReplyTo");
openapiFields.add("body");
openapiFields.add("templateId");
openapiFields.add("templateVariables");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("field");
openapiRequiredFields.add("match");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UpdateInboxReplierOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UpdateInboxReplierOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateInboxReplierOptions is not found in the empty JSON string", UpdateInboxReplierOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UpdateInboxReplierOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateInboxReplierOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UpdateInboxReplierOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("match").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `match` to be a primitive type in the JSON string but got `%s`", jsonObj.get("match").toString()));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("templateId") != null && !jsonObj.get("templateId").isJsonNull()) && !jsonObj.get("templateId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `templateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UpdateInboxReplierOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateInboxReplierOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UpdateInboxReplierOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateInboxReplierOptions.class));
return (TypeAdapter<T>) new TypeAdapter<UpdateInboxReplierOptions>() {
@Override
public void write(JsonWriter out, UpdateInboxReplierOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UpdateInboxReplierOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UpdateInboxReplierOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateInboxReplierOptions
* @throws IOException if the JSON string is invalid with respect to UpdateInboxReplierOptions
*/
public static UpdateInboxReplierOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateInboxReplierOptions.class);
}
/**
* Convert an instance of UpdateInboxReplierOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for updating inbox properties
*/
@ApiModel(description = "Options for updating inbox properties")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UpdateInboxOptions {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt";
@SerializedName(SERIALIZED_NAME_EXPIRES_AT)
private OffsetDateTime expiresAt;
public static final String SERIALIZED_NAME_FAVOURITE = "favourite";
@SerializedName(SERIALIZED_NAME_FAVOURITE)
private Boolean favourite;
public UpdateInboxOptions() {
}
public UpdateInboxOptions name(String name) {
this.name = name;
return this;
}
/**
* Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public UpdateInboxOptions description(String description) {
this.description = description;
return this;
}
/**
* Description of an inbox for labelling and searching purposes
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Description of an inbox for labelling and searching purposes")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public UpdateInboxOptions tags(List<String> tags) {
this.tags = tags;
return this;
}
public UpdateInboxOptions addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public UpdateInboxOptions expiresAt(OffsetDateTime expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.
* @return expiresAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.")
public OffsetDateTime getExpiresAt() {
return expiresAt;
}
public void setExpiresAt(OffsetDateTime expiresAt) {
this.expiresAt = expiresAt;
}
public UpdateInboxOptions favourite(Boolean favourite) {
this.favourite = favourite;
return this;
}
/**
* Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering
* @return favourite
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering")
public Boolean getFavourite() {
return favourite;
}
public void setFavourite(Boolean favourite) {
this.favourite = favourite;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateInboxOptions updateInboxOptions = (UpdateInboxOptions) o;
return Objects.equals(this.name, updateInboxOptions.name) &&
Objects.equals(this.description, updateInboxOptions.description) &&
Objects.equals(this.tags, updateInboxOptions.tags) &&
Objects.equals(this.expiresAt, updateInboxOptions.expiresAt) &&
Objects.equals(this.favourite, updateInboxOptions.favourite);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(name, description, tags, expiresAt, favourite);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateInboxOptions {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
sb.append(" favourite: ").append(toIndentedString(favourite)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("description");
openapiFields.add("tags");
openapiFields.add("expiresAt");
openapiFields.add("favourite");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UpdateInboxOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UpdateInboxOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateInboxOptions is not found in the empty JSON string", UpdateInboxOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UpdateInboxOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateInboxOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UpdateInboxOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateInboxOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UpdateInboxOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateInboxOptions.class));
return (TypeAdapter<T>) new TypeAdapter<UpdateInboxOptions>() {
@Override
public void write(JsonWriter out, UpdateInboxOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UpdateInboxOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UpdateInboxOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateInboxOptions
* @throws IOException if the JSON string is invalid with respect to UpdateInboxOptions
*/
public static UpdateInboxOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateInboxOptions.class);
}
/**
* Convert an instance of UpdateInboxOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Update group contacts options. Pass a list of contact ids to replace existing group contacts.
*/
@ApiModel(description = "Update group contacts options. Pass a list of contact ids to replace existing group contacts.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UpdateGroupContacts {
public static final String SERIALIZED_NAME_CONTACT_IDS = "contactIds";
@SerializedName(SERIALIZED_NAME_CONTACT_IDS)
private List<UUID> contactIds = new ArrayList<>();
public UpdateGroupContacts() {
}
public UpdateGroupContacts contactIds(List<UUID> contactIds) {
this.contactIds = contactIds;
return this;
}
public UpdateGroupContacts addContactIdsItem(UUID contactIdsItem) {
this.contactIds.add(contactIdsItem);
return this;
}
/**
* Get contactIds
* @return contactIds
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<UUID> getContactIds() {
return contactIds;
}
public void setContactIds(List<UUID> contactIds) {
this.contactIds = contactIds;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateGroupContacts updateGroupContacts = (UpdateGroupContacts) o;
return Objects.equals(this.contactIds, updateGroupContacts.contactIds);
}
@Override
public int hashCode() {
return Objects.hash(contactIds);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateGroupContacts {\n");
sb.append(" contactIds: ").append(toIndentedString(contactIds)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("contactIds");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("contactIds");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UpdateGroupContacts
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UpdateGroupContacts.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateGroupContacts is not found in the empty JSON string", UpdateGroupContacts.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UpdateGroupContacts.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateGroupContacts` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UpdateGroupContacts.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("contactIds") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("contactIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `contactIds` to be an array in the JSON string but got `%s`", jsonObj.get("contactIds").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UpdateGroupContacts.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateGroupContacts' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UpdateGroupContacts> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateGroupContacts.class));
return (TypeAdapter<T>) new TypeAdapter<UpdateGroupContacts>() {
@Override
public void write(JsonWriter out, UpdateGroupContacts value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UpdateGroupContacts read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UpdateGroupContacts given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateGroupContacts
* @throws IOException if the JSON string is invalid with respect to UpdateGroupContacts
*/
public static UpdateGroupContacts fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateGroupContacts.class);
}
/**
* Convert an instance of UpdateGroupContacts to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not functionally currently until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help.
*/
@ApiModel(description = "Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not functionally currently until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UpdateDomainOptions {
public static final String SERIALIZED_NAME_CATCH_ALL_INBOX_ID = "catchAllInboxId";
@SerializedName(SERIALIZED_NAME_CATCH_ALL_INBOX_ID)
private UUID catchAllInboxId;
public UpdateDomainOptions() {
}
public UpdateDomainOptions catchAllInboxId(UUID catchAllInboxId) {
this.catchAllInboxId = catchAllInboxId;
return this;
}
/**
* Get catchAllInboxId
* @return catchAllInboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getCatchAllInboxId() {
return catchAllInboxId;
}
public void setCatchAllInboxId(UUID catchAllInboxId) {
this.catchAllInboxId = catchAllInboxId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateDomainOptions updateDomainOptions = (UpdateDomainOptions) o;
return Objects.equals(this.catchAllInboxId, updateDomainOptions.catchAllInboxId);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(catchAllInboxId);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateDomainOptions {\n");
sb.append(" catchAllInboxId: ").append(toIndentedString(catchAllInboxId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("catchAllInboxId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UpdateDomainOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UpdateDomainOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateDomainOptions is not found in the empty JSON string", UpdateDomainOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UpdateDomainOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateDomainOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("catchAllInboxId") != null && !jsonObj.get("catchAllInboxId").isJsonNull()) && !jsonObj.get("catchAllInboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `catchAllInboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catchAllInboxId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UpdateDomainOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateDomainOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UpdateDomainOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateDomainOptions.class));
return (TypeAdapter<T>) new TypeAdapter<UpdateDomainOptions>() {
@Override
public void write(JsonWriter out, UpdateDomainOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UpdateDomainOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UpdateDomainOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateDomainOptions
* @throws IOException if the JSON string is invalid with respect to UpdateDomainOptions
*/
public static UpdateDomainOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateDomainOptions.class);
}
/**
* Convert an instance of UpdateDomainOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Update an email alias
*/
@ApiModel(description = "Update an email alias")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UpdateAliasOptions {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public UpdateAliasOptions() {
}
public UpdateAliasOptions name(String name) {
this.name = name;
return this;
}
/**
* Optional name for alias
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional name for alias")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateAliasOptions updateAliasOptions = (UpdateAliasOptions) o;
return Objects.equals(this.name, updateAliasOptions.name);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(name);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UpdateAliasOptions {\n");
sb.append(" name: ").append(toIndentedString(name)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UpdateAliasOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UpdateAliasOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateAliasOptions is not found in the empty JSON string", UpdateAliasOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UpdateAliasOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateAliasOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UpdateAliasOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UpdateAliasOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UpdateAliasOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UpdateAliasOptions.class));
return (TypeAdapter<T>) new TypeAdapter<UpdateAliasOptions>() {
@Override
public void write(JsonWriter out, UpdateAliasOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UpdateAliasOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UpdateAliasOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of UpdateAliasOptions
* @throws IOException if the JSON string is invalid with respect to UpdateAliasOptions
*/
public static UpdateAliasOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UpdateAliasOptions.class);
}
/**
* Convert an instance of UpdateAliasOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Number of unseen errors
*/
@ApiModel(description = "Number of unseen errors")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UnseenErrorCountDto {
public static final String SERIALIZED_NAME_COUNT = "count";
@SerializedName(SERIALIZED_NAME_COUNT)
private Long count;
public UnseenErrorCountDto() {
}
public UnseenErrorCountDto count(Long count) {
this.count = count;
return this;
}
/**
* Get count
* @return count
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UnseenErrorCountDto unseenErrorCountDto = (UnseenErrorCountDto) o;
return Objects.equals(this.count, unseenErrorCountDto.count);
}
@Override
public int hashCode() {
return Objects.hash(count);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UnseenErrorCountDto {\n");
sb.append(" count: ").append(toIndentedString(count)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("count");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("count");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UnseenErrorCountDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UnseenErrorCountDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UnseenErrorCountDto is not found in the empty JSON string", UnseenErrorCountDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UnseenErrorCountDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UnseenErrorCountDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UnseenErrorCountDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UnseenErrorCountDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UnseenErrorCountDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UnseenErrorCountDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UnseenErrorCountDto.class));
return (TypeAdapter<T>) new TypeAdapter<UnseenErrorCountDto>() {
@Override
public void write(JsonWriter out, UnseenErrorCountDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UnseenErrorCountDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UnseenErrorCountDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of UnseenErrorCountDto
* @throws IOException if the JSON string is invalid with respect to UnseenErrorCountDto
*/
public static UnseenErrorCountDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UnseenErrorCountDto.class);
}
/**
* Convert an instance of UnseenErrorCountDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Number of unread entities
*/
@ApiModel(description = "Number of unread entities")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UnreadCount {
public static final String SERIALIZED_NAME_COUNT = "count";
@SerializedName(SERIALIZED_NAME_COUNT)
private Long count;
public UnreadCount() {
}
public UnreadCount count(Long count) {
this.count = count;
return this;
}
/**
* Get count
* @return count
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UnreadCount unreadCount = (UnreadCount) o;
return Objects.equals(this.count, unreadCount.count);
}
@Override
public int hashCode() {
return Objects.hash(count);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UnreadCount {\n");
sb.append(" count: ").append(toIndentedString(count)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("count");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("count");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UnreadCount
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UnreadCount.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UnreadCount is not found in the empty JSON string", UnreadCount.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UnreadCount.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UnreadCount` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UnreadCount.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UnreadCount.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UnreadCount' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UnreadCount> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UnreadCount.class));
return (TypeAdapter<T>) new TypeAdapter<UnreadCount>() {
@Override
public void write(JsonWriter out, UnreadCount value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UnreadCount read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UnreadCount given an JSON string
*
* @param jsonString JSON string
* @return An instance of UnreadCount
* @throws IOException if the JSON string is invalid with respect to UnreadCount
*/
public static UnreadCount fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UnreadCount.class);
}
/**
* Convert an instance of UnreadCount to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Unknown missed email projection
*/
@ApiModel(description = "Unknown missed email projection")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class UnknownMissedEmailProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = null;
public UnknownMissedEmailProjection() {
}
public UnknownMissedEmailProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public UnknownMissedEmailProjection from(String from) {
this.from = from;
return this;
}
/**
* Get from
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public UnknownMissedEmailProjection subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public UnknownMissedEmailProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public UnknownMissedEmailProjection to(List<String> to) {
this.to = to;
return this;
}
public UnknownMissedEmailProjection addToItem(String toItem) {
if (this.to == null) {
this.to = new ArrayList<>();
}
this.to.add(toItem);
return this;
}
/**
* Get to
* @return to
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UnknownMissedEmailProjection unknownMissedEmailProjection = (UnknownMissedEmailProjection) o;
return Objects.equals(this.id, unknownMissedEmailProjection.id) &&
Objects.equals(this.from, unknownMissedEmailProjection.from) &&
Objects.equals(this.subject, unknownMissedEmailProjection.subject) &&
Objects.equals(this.createdAt, unknownMissedEmailProjection.createdAt) &&
Objects.equals(this.to, unknownMissedEmailProjection.to);
}
@Override
public int hashCode() {
return Objects.hash(id, from, subject, createdAt, to);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UnknownMissedEmailProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("from");
openapiFields.add("subject");
openapiFields.add("createdAt");
openapiFields.add("to");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to UnknownMissedEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!UnknownMissedEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in UnknownMissedEmailProjection is not found in the empty JSON string", UnknownMissedEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!UnknownMissedEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UnknownMissedEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : UnknownMissedEmailProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!UnknownMissedEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'UnknownMissedEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<UnknownMissedEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(UnknownMissedEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<UnknownMissedEmailProjection>() {
@Override
public void write(JsonWriter out, UnknownMissedEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public UnknownMissedEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of UnknownMissedEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of UnknownMissedEmailProjection
* @throws IOException if the JSON string is invalid with respect to UnknownMissedEmailProjection
*/
public static UnknownMissedEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, UnknownMissedEmailProjection.class);
}
/**
* Convert an instance of UnknownMissedEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Tracking pixel data
*/
@ApiModel(description = "Tracking pixel data")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TrackingPixelProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_SENT_EMAIL_ID = "sentEmailId";
@SerializedName(SERIALIZED_NAME_SENT_EMAIL_ID)
private UUID sentEmailId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public static final String SERIALIZED_NAME_SEEN = "seen";
@SerializedName(SERIALIZED_NAME_SEEN)
private Boolean seen;
public static final String SERIALIZED_NAME_SEEN_AT = "seenAt";
@SerializedName(SERIALIZED_NAME_SEEN_AT)
private OffsetDateTime seenAt;
public TrackingPixelProjection() {
}
public TrackingPixelProjection name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public TrackingPixelProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public TrackingPixelProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public TrackingPixelProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public TrackingPixelProjection sentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
return this;
}
/**
* Get sentEmailId
* @return sentEmailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentEmailId() {
return sentEmailId;
}
public void setSentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
}
public TrackingPixelProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public TrackingPixelProjection recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Get recipient
* @return recipient
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
public TrackingPixelProjection seen(Boolean seen) {
this.seen = seen;
return this;
}
/**
* Get seen
* @return seen
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSeen() {
return seen;
}
public void setSeen(Boolean seen) {
this.seen = seen;
}
public TrackingPixelProjection seenAt(OffsetDateTime seenAt) {
this.seenAt = seenAt;
return this;
}
/**
* Get seenAt
* @return seenAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getSeenAt() {
return seenAt;
}
public void setSeenAt(OffsetDateTime seenAt) {
this.seenAt = seenAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TrackingPixelProjection trackingPixelProjection = (TrackingPixelProjection) o;
return Objects.equals(this.name, trackingPixelProjection.name) &&
Objects.equals(this.id, trackingPixelProjection.id) &&
Objects.equals(this.inboxId, trackingPixelProjection.inboxId) &&
Objects.equals(this.userId, trackingPixelProjection.userId) &&
Objects.equals(this.sentEmailId, trackingPixelProjection.sentEmailId) &&
Objects.equals(this.createdAt, trackingPixelProjection.createdAt) &&
Objects.equals(this.recipient, trackingPixelProjection.recipient) &&
Objects.equals(this.seen, trackingPixelProjection.seen) &&
Objects.equals(this.seenAt, trackingPixelProjection.seenAt);
}
@Override
public int hashCode() {
return Objects.hash(name, id, inboxId, userId, sentEmailId, createdAt, recipient, seen, seenAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TrackingPixelProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" sentEmailId: ").append(toIndentedString(sentEmailId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n");
sb.append(" seen: ").append(toIndentedString(seen)).append("\n");
sb.append(" seenAt: ").append(toIndentedString(seenAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("sentEmailId");
openapiFields.add("createdAt");
openapiFields.add("recipient");
openapiFields.add("seen");
openapiFields.add("seenAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("seen");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TrackingPixelProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TrackingPixelProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingPixelProjection is not found in the empty JSON string", TrackingPixelProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TrackingPixelProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingPixelProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TrackingPixelProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("sentEmailId") != null && !jsonObj.get("sentEmailId").isJsonNull()) && !jsonObj.get("sentEmailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentEmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentEmailId").toString()));
}
if ((jsonObj.get("recipient") != null && !jsonObj.get("recipient").isJsonNull()) && !jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TrackingPixelProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TrackingPixelProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TrackingPixelProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TrackingPixelProjection.class));
return (TypeAdapter<T>) new TypeAdapter<TrackingPixelProjection>() {
@Override
public void write(JsonWriter out, TrackingPixelProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TrackingPixelProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TrackingPixelProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of TrackingPixelProjection
* @throws IOException if the JSON string is invalid with respect to TrackingPixelProjection
*/
public static TrackingPixelProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TrackingPixelProjection.class);
}
/**
* Convert an instance of TrackingPixelProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Tracking pixel
*/
@ApiModel(description = "Tracking pixel")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TrackingPixelDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_SEEN = "seen";
@SerializedName(SERIALIZED_NAME_SEEN)
private Boolean seen;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private String html;
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_SENT_EMAIL_ID = "sentEmailId";
@SerializedName(SERIALIZED_NAME_SENT_EMAIL_ID)
private UUID sentEmailId;
public static final String SERIALIZED_NAME_SEEN_AT = "seenAt";
@SerializedName(SERIALIZED_NAME_SEEN_AT)
private OffsetDateTime seenAt;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public TrackingPixelDto() {
}
public TrackingPixelDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public TrackingPixelDto seen(Boolean seen) {
this.seen = seen;
return this;
}
/**
* Get seen
* @return seen
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSeen() {
return seen;
}
public void setSeen(Boolean seen) {
this.seen = seen;
}
public TrackingPixelDto recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Get recipient
* @return recipient
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
public TrackingPixelDto html(String html) {
this.html = html;
return this;
}
/**
* Get html
* @return html
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getHtml() {
return html;
}
public void setHtml(String html) {
this.html = html;
}
public TrackingPixelDto url(String url) {
this.url = url;
return this;
}
/**
* Get url
* @return url
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public TrackingPixelDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public TrackingPixelDto sentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
return this;
}
/**
* Get sentEmailId
* @return sentEmailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentEmailId() {
return sentEmailId;
}
public void setSentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
}
public TrackingPixelDto seenAt(OffsetDateTime seenAt) {
this.seenAt = seenAt;
return this;
}
/**
* Get seenAt
* @return seenAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getSeenAt() {
return seenAt;
}
public void setSeenAt(OffsetDateTime seenAt) {
this.seenAt = seenAt;
}
public TrackingPixelDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TrackingPixelDto trackingPixelDto = (TrackingPixelDto) o;
return Objects.equals(this.id, trackingPixelDto.id) &&
Objects.equals(this.seen, trackingPixelDto.seen) &&
Objects.equals(this.recipient, trackingPixelDto.recipient) &&
Objects.equals(this.html, trackingPixelDto.html) &&
Objects.equals(this.url, trackingPixelDto.url) &&
Objects.equals(this.inboxId, trackingPixelDto.inboxId) &&
Objects.equals(this.sentEmailId, trackingPixelDto.sentEmailId) &&
Objects.equals(this.seenAt, trackingPixelDto.seenAt) &&
Objects.equals(this.createdAt, trackingPixelDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, seen, recipient, html, url, inboxId, sentEmailId, seenAt, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TrackingPixelDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" seen: ").append(toIndentedString(seen)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" sentEmailId: ").append(toIndentedString(sentEmailId)).append("\n");
sb.append(" seenAt: ").append(toIndentedString(seenAt)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("seen");
openapiFields.add("recipient");
openapiFields.add("html");
openapiFields.add("url");
openapiFields.add("inboxId");
openapiFields.add("sentEmailId");
openapiFields.add("seenAt");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("seen");
openapiRequiredFields.add("html");
openapiRequiredFields.add("url");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TrackingPixelDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TrackingPixelDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingPixelDto is not found in the empty JSON string", TrackingPixelDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TrackingPixelDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingPixelDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TrackingPixelDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("recipient") != null && !jsonObj.get("recipient").isJsonNull()) && !jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
if (!jsonObj.get("html").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `html` to be a primitive type in the JSON string but got `%s`", jsonObj.get("html").toString()));
}
if (!jsonObj.get("url").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("sentEmailId") != null && !jsonObj.get("sentEmailId").isJsonNull()) && !jsonObj.get("sentEmailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentEmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentEmailId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TrackingPixelDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TrackingPixelDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TrackingPixelDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TrackingPixelDto.class));
return (TypeAdapter<T>) new TypeAdapter<TrackingPixelDto>() {
@Override
public void write(JsonWriter out, TrackingPixelDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TrackingPixelDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TrackingPixelDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of TrackingPixelDto
* @throws IOException if the JSON string is invalid with respect to TrackingPixelDto
*/
public static TrackingPixelDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TrackingPixelDto.class);
}
/**
* Convert an instance of TrackingPixelDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* A thread is a message thread created for a message received by an alias
*/
@ApiModel(description = "A thread is a message thread created for a message received by an alias")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ThreadProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_ALIAS_ID = "aliasId";
@SerializedName(SERIALIZED_NAME_ALIAS_ID)
private UUID aliasId;
public ThreadProjection() {
}
public ThreadProjection name(String name) {
this.name = name;
return this;
}
/**
* Name of thread
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of thread")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ThreadProjection id(UUID id) {
this.id = id;
return this;
}
/**
* ID of email thread
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of email thread")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ThreadProjection subject(String subject) {
this.subject = subject;
return this;
}
/**
* Thread subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Thread subject")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public ThreadProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Inbox ID
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inbox ID")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public ThreadProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* User ID
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "User ID")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public ThreadProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Created at DateTime
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Created at DateTime")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ThreadProjection updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Updated at DateTime
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Updated at DateTime")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public ThreadProjection to(List<String> to) {
this.to = to;
return this;
}
public ThreadProjection addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* To recipients
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "To recipients")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public ThreadProjection bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public ThreadProjection addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* BCC recipients
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "BCC recipients")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public ThreadProjection cc(List<String> cc) {
this.cc = cc;
return this;
}
public ThreadProjection addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* CC recipients
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "CC recipients")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public ThreadProjection aliasId(UUID aliasId) {
this.aliasId = aliasId;
return this;
}
/**
* Alias ID
* @return aliasId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Alias ID")
public UUID getAliasId() {
return aliasId;
}
public void setAliasId(UUID aliasId) {
this.aliasId = aliasId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ThreadProjection threadProjection = (ThreadProjection) o;
return Objects.equals(this.name, threadProjection.name) &&
Objects.equals(this.id, threadProjection.id) &&
Objects.equals(this.subject, threadProjection.subject) &&
Objects.equals(this.inboxId, threadProjection.inboxId) &&
Objects.equals(this.userId, threadProjection.userId) &&
Objects.equals(this.createdAt, threadProjection.createdAt) &&
Objects.equals(this.updatedAt, threadProjection.updatedAt) &&
Objects.equals(this.to, threadProjection.to) &&
Objects.equals(this.bcc, threadProjection.bcc) &&
Objects.equals(this.cc, threadProjection.cc) &&
Objects.equals(this.aliasId, threadProjection.aliasId);
}
@Override
public int hashCode() {
return Objects.hash(name, id, subject, inboxId, userId, createdAt, updatedAt, to, bcc, cc, aliasId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ThreadProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" aliasId: ").append(toIndentedString(aliasId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("id");
openapiFields.add("subject");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("to");
openapiFields.add("bcc");
openapiFields.add("cc");
openapiFields.add("aliasId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
openapiRequiredFields.add("to");
openapiRequiredFields.add("aliasId");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ThreadProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ThreadProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ThreadProjection is not found in the empty JSON string", ThreadProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ThreadProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreadProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ThreadProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
if (!jsonObj.get("aliasId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `aliasId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ThreadProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ThreadProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ThreadProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ThreadProjection.class));
return (TypeAdapter<T>) new TypeAdapter<ThreadProjection>() {
@Override
public void write(JsonWriter out, ThreadProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ThreadProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ThreadProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of ThreadProjection
* @throws IOException if the JSON string is invalid with respect to ThreadProjection
*/
public static ThreadProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ThreadProjection.class);
}
/**
* Convert an instance of ThreadProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* TestPhoneNumberOptions
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TestPhoneNumberOptions {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public TestPhoneNumberOptions() {
}
public TestPhoneNumberOptions message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestPhoneNumberOptions testPhoneNumberOptions = (TestPhoneNumberOptions) o;
return Objects.equals(this.message, testPhoneNumberOptions.message);
}
@Override
public int hashCode() {
return Objects.hash(message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestPhoneNumberOptions {\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("message");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("message");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TestPhoneNumberOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TestPhoneNumberOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TestPhoneNumberOptions is not found in the empty JSON string", TestPhoneNumberOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TestPhoneNumberOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestPhoneNumberOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TestPhoneNumberOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TestPhoneNumberOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TestPhoneNumberOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TestPhoneNumberOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TestPhoneNumberOptions.class));
return (TypeAdapter<T>) new TypeAdapter<TestPhoneNumberOptions>() {
@Override
public void write(JsonWriter out, TestPhoneNumberOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TestPhoneNumberOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TestPhoneNumberOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestPhoneNumberOptions
* @throws IOException if the JSON string is invalid with respect to TestPhoneNumberOptions
*/
public static TestPhoneNumberOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestPhoneNumberOptions.class);
}
/**
* Convert an instance of TestPhoneNumberOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.CreateInboxRulesetOptions;
import com.mailslurp.models.InboxRulesetTestOptions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Test inbox ruleset options
*/
@ApiModel(description = "Test inbox ruleset options")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TestNewInboxRulesetOptions {
public static final String SERIALIZED_NAME_INBOX_RULESET_TEST_OPTIONS = "inboxRulesetTestOptions";
@SerializedName(SERIALIZED_NAME_INBOX_RULESET_TEST_OPTIONS)
private InboxRulesetTestOptions inboxRulesetTestOptions;
public static final String SERIALIZED_NAME_CREATE_INBOX_RULESET_OPTIONS = "createInboxRulesetOptions";
@SerializedName(SERIALIZED_NAME_CREATE_INBOX_RULESET_OPTIONS)
private CreateInboxRulesetOptions createInboxRulesetOptions;
public TestNewInboxRulesetOptions() {
}
public TestNewInboxRulesetOptions inboxRulesetTestOptions(InboxRulesetTestOptions inboxRulesetTestOptions) {
this.inboxRulesetTestOptions = inboxRulesetTestOptions;
return this;
}
/**
* Get inboxRulesetTestOptions
* @return inboxRulesetTestOptions
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public InboxRulesetTestOptions getInboxRulesetTestOptions() {
return inboxRulesetTestOptions;
}
public void setInboxRulesetTestOptions(InboxRulesetTestOptions inboxRulesetTestOptions) {
this.inboxRulesetTestOptions = inboxRulesetTestOptions;
}
public TestNewInboxRulesetOptions createInboxRulesetOptions(CreateInboxRulesetOptions createInboxRulesetOptions) {
this.createInboxRulesetOptions = createInboxRulesetOptions;
return this;
}
/**
* Get createInboxRulesetOptions
* @return createInboxRulesetOptions
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public CreateInboxRulesetOptions getCreateInboxRulesetOptions() {
return createInboxRulesetOptions;
}
public void setCreateInboxRulesetOptions(CreateInboxRulesetOptions createInboxRulesetOptions) {
this.createInboxRulesetOptions = createInboxRulesetOptions;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestNewInboxRulesetOptions testNewInboxRulesetOptions = (TestNewInboxRulesetOptions) o;
return Objects.equals(this.inboxRulesetTestOptions, testNewInboxRulesetOptions.inboxRulesetTestOptions) &&
Objects.equals(this.createInboxRulesetOptions, testNewInboxRulesetOptions.createInboxRulesetOptions);
}
@Override
public int hashCode() {
return Objects.hash(inboxRulesetTestOptions, createInboxRulesetOptions);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestNewInboxRulesetOptions {\n");
sb.append(" inboxRulesetTestOptions: ").append(toIndentedString(inboxRulesetTestOptions)).append("\n");
sb.append(" createInboxRulesetOptions: ").append(toIndentedString(createInboxRulesetOptions)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxRulesetTestOptions");
openapiFields.add("createInboxRulesetOptions");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxRulesetTestOptions");
openapiRequiredFields.add("createInboxRulesetOptions");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TestNewInboxRulesetOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TestNewInboxRulesetOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TestNewInboxRulesetOptions is not found in the empty JSON string", TestNewInboxRulesetOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TestNewInboxRulesetOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestNewInboxRulesetOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TestNewInboxRulesetOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// validate the required field `inboxRulesetTestOptions`
InboxRulesetTestOptions.validateJsonObject(jsonObj.getAsJsonObject("inboxRulesetTestOptions"));
// validate the required field `createInboxRulesetOptions`
CreateInboxRulesetOptions.validateJsonObject(jsonObj.getAsJsonObject("createInboxRulesetOptions"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TestNewInboxRulesetOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TestNewInboxRulesetOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TestNewInboxRulesetOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TestNewInboxRulesetOptions.class));
return (TypeAdapter<T>) new TypeAdapter<TestNewInboxRulesetOptions>() {
@Override
public void write(JsonWriter out, TestNewInboxRulesetOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TestNewInboxRulesetOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TestNewInboxRulesetOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestNewInboxRulesetOptions
* @throws IOException if the JSON string is invalid with respect to TestNewInboxRulesetOptions
*/
public static TestNewInboxRulesetOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestNewInboxRulesetOptions.class);
}
/**
* Convert an instance of TestNewInboxRulesetOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.CreateInboxForwarderOptions;
import com.mailslurp.models.InboxForwarderTestOptions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for testing new inbox forwarder rules
*/
@ApiModel(description = "Options for testing new inbox forwarder rules")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TestNewInboxForwarderOptions {
public static final String SERIALIZED_NAME_INBOX_FORWARDER_TEST_OPTIONS = "inboxForwarderTestOptions";
@SerializedName(SERIALIZED_NAME_INBOX_FORWARDER_TEST_OPTIONS)
private InboxForwarderTestOptions inboxForwarderTestOptions;
public static final String SERIALIZED_NAME_CREATE_INBOX_FORWARDER_OPTIONS = "createInboxForwarderOptions";
@SerializedName(SERIALIZED_NAME_CREATE_INBOX_FORWARDER_OPTIONS)
private CreateInboxForwarderOptions createInboxForwarderOptions;
public TestNewInboxForwarderOptions() {
}
public TestNewInboxForwarderOptions inboxForwarderTestOptions(InboxForwarderTestOptions inboxForwarderTestOptions) {
this.inboxForwarderTestOptions = inboxForwarderTestOptions;
return this;
}
/**
* Get inboxForwarderTestOptions
* @return inboxForwarderTestOptions
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public InboxForwarderTestOptions getInboxForwarderTestOptions() {
return inboxForwarderTestOptions;
}
public void setInboxForwarderTestOptions(InboxForwarderTestOptions inboxForwarderTestOptions) {
this.inboxForwarderTestOptions = inboxForwarderTestOptions;
}
public TestNewInboxForwarderOptions createInboxForwarderOptions(CreateInboxForwarderOptions createInboxForwarderOptions) {
this.createInboxForwarderOptions = createInboxForwarderOptions;
return this;
}
/**
* Get createInboxForwarderOptions
* @return createInboxForwarderOptions
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public CreateInboxForwarderOptions getCreateInboxForwarderOptions() {
return createInboxForwarderOptions;
}
public void setCreateInboxForwarderOptions(CreateInboxForwarderOptions createInboxForwarderOptions) {
this.createInboxForwarderOptions = createInboxForwarderOptions;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestNewInboxForwarderOptions testNewInboxForwarderOptions = (TestNewInboxForwarderOptions) o;
return Objects.equals(this.inboxForwarderTestOptions, testNewInboxForwarderOptions.inboxForwarderTestOptions) &&
Objects.equals(this.createInboxForwarderOptions, testNewInboxForwarderOptions.createInboxForwarderOptions);
}
@Override
public int hashCode() {
return Objects.hash(inboxForwarderTestOptions, createInboxForwarderOptions);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestNewInboxForwarderOptions {\n");
sb.append(" inboxForwarderTestOptions: ").append(toIndentedString(inboxForwarderTestOptions)).append("\n");
sb.append(" createInboxForwarderOptions: ").append(toIndentedString(createInboxForwarderOptions)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxForwarderTestOptions");
openapiFields.add("createInboxForwarderOptions");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxForwarderTestOptions");
openapiRequiredFields.add("createInboxForwarderOptions");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TestNewInboxForwarderOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TestNewInboxForwarderOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TestNewInboxForwarderOptions is not found in the empty JSON string", TestNewInboxForwarderOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TestNewInboxForwarderOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestNewInboxForwarderOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TestNewInboxForwarderOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// validate the required field `inboxForwarderTestOptions`
InboxForwarderTestOptions.validateJsonObject(jsonObj.getAsJsonObject("inboxForwarderTestOptions"));
// validate the required field `createInboxForwarderOptions`
CreateInboxForwarderOptions.validateJsonObject(jsonObj.getAsJsonObject("createInboxForwarderOptions"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TestNewInboxForwarderOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TestNewInboxForwarderOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TestNewInboxForwarderOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TestNewInboxForwarderOptions.class));
return (TypeAdapter<T>) new TypeAdapter<TestNewInboxForwarderOptions>() {
@Override
public void write(JsonWriter out, TestNewInboxForwarderOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TestNewInboxForwarderOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TestNewInboxForwarderOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestNewInboxForwarderOptions
* @throws IOException if the JSON string is invalid with respect to TestNewInboxForwarderOptions
*/
public static TestNewInboxForwarderOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestNewInboxForwarderOptions.class);
}
/**
* Convert an instance of TestNewInboxForwarderOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Variable for use with email template
*/
@ApiModel(description = "Variable for use with email template")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TemplateVariable {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* The type of variable
*/
@JsonAdapter(VariableTypeEnum.Adapter.class)
public enum VariableTypeEnum {
STRING("STRING");
private String value;
VariableTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static VariableTypeEnum fromValue(String value) {
for (VariableTypeEnum b : VariableTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<VariableTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final VariableTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public VariableTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return VariableTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_VARIABLE_TYPE = "variableType";
@SerializedName(SERIALIZED_NAME_VARIABLE_TYPE)
private VariableTypeEnum variableType;
public TemplateVariable() {
}
public TemplateVariable name(String name) {
this.name = name;
return this;
}
/**
* Name of variable. This can be used in a template as {{name}}
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of variable. This can be used in a template as {{name}}")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public TemplateVariable variableType(VariableTypeEnum variableType) {
this.variableType = variableType;
return this;
}
/**
* The type of variable
* @return variableType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The type of variable")
public VariableTypeEnum getVariableType() {
return variableType;
}
public void setVariableType(VariableTypeEnum variableType) {
this.variableType = variableType;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TemplateVariable templateVariable = (TemplateVariable) o;
return Objects.equals(this.name, templateVariable.name) &&
Objects.equals(this.variableType, templateVariable.variableType);
}
@Override
public int hashCode() {
return Objects.hash(name, variableType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TemplateVariable {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" variableType: ").append(toIndentedString(variableType)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("variableType");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
openapiRequiredFields.add("variableType");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TemplateVariable
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TemplateVariable.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TemplateVariable is not found in the empty JSON string", TemplateVariable.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TemplateVariable.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TemplateVariable` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TemplateVariable.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("variableType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `variableType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("variableType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TemplateVariable.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TemplateVariable' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TemplateVariable> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TemplateVariable.class));
return (TypeAdapter<T>) new TypeAdapter<TemplateVariable>() {
@Override
public void write(JsonWriter out, TemplateVariable value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TemplateVariable read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TemplateVariable given an JSON string
*
* @param jsonString JSON string
* @return An instance of TemplateVariable
* @throws IOException if the JSON string is invalid with respect to TemplateVariable
*/
public static TemplateVariable fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TemplateVariable.class);
}
/**
* Convert an instance of TemplateVariable to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email template data
*/
@ApiModel(description = "Email template data")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TemplateProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_VARIABLES = "variables";
@SerializedName(SERIALIZED_NAME_VARIABLES)
private List<String> variables = new ArrayList<>();
public TemplateProjection() {
}
public TemplateProjection name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public TemplateProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public TemplateProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public TemplateProjection updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public TemplateProjection variables(List<String> variables) {
this.variables = variables;
return this;
}
public TemplateProjection addVariablesItem(String variablesItem) {
this.variables.add(variablesItem);
return this;
}
/**
* Get variables
* @return variables
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getVariables() {
return variables;
}
public void setVariables(List<String> variables) {
this.variables = variables;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TemplateProjection templateProjection = (TemplateProjection) o;
return Objects.equals(this.name, templateProjection.name) &&
Objects.equals(this.id, templateProjection.id) &&
Objects.equals(this.createdAt, templateProjection.createdAt) &&
Objects.equals(this.updatedAt, templateProjection.updatedAt) &&
Objects.equals(this.variables, templateProjection.variables);
}
@Override
public int hashCode() {
return Objects.hash(name, id, createdAt, updatedAt, variables);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TemplateProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" variables: ").append(toIndentedString(variables)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("id");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("variables");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
openapiRequiredFields.add("variables");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TemplateProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TemplateProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TemplateProjection is not found in the empty JSON string", TemplateProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TemplateProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TemplateProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TemplateProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
// ensure the required json array is present
if (jsonObj.get("variables") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("variables").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `variables` to be an array in the JSON string but got `%s`", jsonObj.get("variables").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TemplateProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TemplateProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TemplateProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TemplateProjection.class));
return (TypeAdapter<T>) new TypeAdapter<TemplateProjection>() {
@Override
public void write(JsonWriter out, TemplateProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TemplateProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TemplateProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of TemplateProjection
* @throws IOException if the JSON string is invalid with respect to TemplateProjection
*/
public static TemplateProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TemplateProjection.class);
}
/**
* Convert an instance of TemplateProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* TemplatePreview
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TemplatePreview {
public static final String SERIALIZED_NAME_PREVIEW = "preview";
@SerializedName(SERIALIZED_NAME_PREVIEW)
private String preview;
public TemplatePreview() {
}
public TemplatePreview preview(String preview) {
this.preview = preview;
return this;
}
/**
* Get preview
* @return preview
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPreview() {
return preview;
}
public void setPreview(String preview) {
this.preview = preview;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TemplatePreview templatePreview = (TemplatePreview) o;
return Objects.equals(this.preview, templatePreview.preview);
}
@Override
public int hashCode() {
return Objects.hash(preview);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TemplatePreview {\n");
sb.append(" preview: ").append(toIndentedString(preview)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("preview");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("preview");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TemplatePreview
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TemplatePreview.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TemplatePreview is not found in the empty JSON string", TemplatePreview.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TemplatePreview.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TemplatePreview` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TemplatePreview.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("preview").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `preview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("preview").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TemplatePreview.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TemplatePreview' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TemplatePreview> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TemplatePreview.class));
return (TypeAdapter<T>) new TypeAdapter<TemplatePreview>() {
@Override
public void write(JsonWriter out, TemplatePreview value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TemplatePreview read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TemplatePreview given an JSON string
*
* @param jsonString JSON string
* @return An instance of TemplatePreview
* @throws IOException if the JSON string is invalid with respect to TemplatePreview
*/
public static TemplatePreview fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TemplatePreview.class);
}
/**
* Convert an instance of TemplatePreview to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.TemplateVariable;
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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email template
*/
@ApiModel(description = "Email template")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class TemplateDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_VARIABLES = "variables";
@SerializedName(SERIALIZED_NAME_VARIABLES)
private List<TemplateVariable> variables = new ArrayList<>();
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private String content;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public TemplateDto() {
}
public TemplateDto id(UUID id) {
this.id = id;
return this;
}
/**
* ID of template
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of template")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public TemplateDto name(String name) {
this.name = name;
return this;
}
/**
* Template name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Template name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public TemplateDto variables(List<TemplateVariable> variables) {
this.variables = variables;
return this;
}
public TemplateDto addVariablesItem(TemplateVariable variablesItem) {
this.variables.add(variablesItem);
return this;
}
/**
* Variables available in template that can be replaced with values
* @return variables
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Variables available in template that can be replaced with values")
public List<TemplateVariable> getVariables() {
return variables;
}
public void setVariables(List<TemplateVariable> variables) {
this.variables = variables;
}
public TemplateDto content(String content) {
this.content = content;
return this;
}
/**
* Content of the template
* @return content
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Content of the template")
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public TemplateDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Created at time
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Created at time")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TemplateDto templateDto = (TemplateDto) o;
return Objects.equals(this.id, templateDto.id) &&
Objects.equals(this.name, templateDto.name) &&
Objects.equals(this.variables, templateDto.variables) &&
Objects.equals(this.content, templateDto.content) &&
Objects.equals(this.createdAt, templateDto.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, name, variables, content, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TemplateDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" variables: ").append(toIndentedString(variables)).append("\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("name");
openapiFields.add("variables");
openapiFields.add("content");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("name");
openapiRequiredFields.add("variables");
openapiRequiredFields.add("content");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to TemplateDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!TemplateDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in TemplateDto is not found in the empty JSON string", TemplateDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!TemplateDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TemplateDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : TemplateDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("variables").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `variables` to be an array in the JSON string but got `%s`", jsonObj.get("variables").toString()));
}
JsonArray jsonArrayvariables = jsonObj.getAsJsonArray("variables");
// validate the required field `variables` (array)
for (int i = 0; i < jsonArrayvariables.size(); i++) {
TemplateVariable.validateJsonObject(jsonArrayvariables.get(i).getAsJsonObject());
};
if (!jsonObj.get("content").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!TemplateDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'TemplateDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<TemplateDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(TemplateDto.class));
return (TypeAdapter<T>) new TypeAdapter<TemplateDto>() {
@Override
public void write(JsonWriter out, TemplateDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public TemplateDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of TemplateDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of TemplateDto
* @throws IOException if the JSON string is invalid with respect to TemplateDto
*/
public static TemplateDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TemplateDto.class);
}
/**
* Convert an instance of TemplateDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Sort
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Sort {
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public static final String SERIALIZED_NAME_SORTED = "sorted";
@SerializedName(SERIALIZED_NAME_SORTED)
private Boolean sorted;
public static final String SERIALIZED_NAME_UNSORTED = "unsorted";
@SerializedName(SERIALIZED_NAME_UNSORTED)
private Boolean unsorted;
public Sort() {
}
public Sort empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
public Sort sorted(Boolean sorted) {
this.sorted = sorted;
return this;
}
/**
* Get sorted
* @return sorted
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getSorted() {
return sorted;
}
public void setSorted(Boolean sorted) {
this.sorted = sorted;
}
public Sort unsorted(Boolean unsorted) {
this.unsorted = unsorted;
return this;
}
/**
* Get unsorted
* @return unsorted
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getUnsorted() {
return unsorted;
}
public void setUnsorted(Boolean unsorted) {
this.unsorted = unsorted;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Sort sort = (Sort) o;
return Objects.equals(this.empty, sort.empty) &&
Objects.equals(this.sorted, sort.sorted) &&
Objects.equals(this.unsorted, sort.unsorted);
}
@Override
public int hashCode() {
return Objects.hash(empty, sorted, unsorted);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Sort {\n");
sb.append(" empty: ").append(toIndentedString(empty)).append("\n");
sb.append(" sorted: ").append(toIndentedString(sorted)).append("\n");
sb.append(" unsorted: ").append(toIndentedString(unsorted)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("empty");
openapiFields.add("sorted");
openapiFields.add("unsorted");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to Sort
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!Sort.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Sort is not found in the empty JSON string", Sort.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!Sort.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Sort` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!Sort.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'Sort' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Sort> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(Sort.class));
return (TypeAdapter<T>) new TypeAdapter<Sort>() {
@Override
public void write(JsonWriter out, Sort value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public Sort read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of Sort given an JSON string
*
* @param jsonString JSON string
* @return An instance of Sort
* @throws IOException if the JSON string is invalid with respect to Sort
*/
public static Sort fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Sort.class);
}
/**
* Convert an instance of Sort to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* SMS projection
*/
@ApiModel(description = "SMS projection")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SmsProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
private UUID phoneNumber;
public static final String SERIALIZED_NAME_FROM_NUMBER = "fromNumber";
@SerializedName(SERIALIZED_NAME_FROM_NUMBER)
private String fromNumber;
public static final String SERIALIZED_NAME_READ = "read";
@SerializedName(SERIALIZED_NAME_READ)
private Boolean read;
public SmsProjection() {
}
public SmsProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public SmsProjection body(String body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public SmsProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public SmsProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public SmsProjection phoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* Get phoneNumber
* @return phoneNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
}
public SmsProjection fromNumber(String fromNumber) {
this.fromNumber = fromNumber;
return this;
}
/**
* Get fromNumber
* @return fromNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getFromNumber() {
return fromNumber;
}
public void setFromNumber(String fromNumber) {
this.fromNumber = fromNumber;
}
public SmsProjection read(Boolean read) {
this.read = read;
return this;
}
/**
* Get read
* @return read
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getRead() {
return read;
}
public void setRead(Boolean read) {
this.read = read;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SmsProjection smsProjection = (SmsProjection) o;
return Objects.equals(this.id, smsProjection.id) &&
Objects.equals(this.body, smsProjection.body) &&
Objects.equals(this.userId, smsProjection.userId) &&
Objects.equals(this.createdAt, smsProjection.createdAt) &&
Objects.equals(this.phoneNumber, smsProjection.phoneNumber) &&
Objects.equals(this.fromNumber, smsProjection.fromNumber) &&
Objects.equals(this.read, smsProjection.read);
}
@Override
public int hashCode() {
return Objects.hash(id, body, userId, createdAt, phoneNumber, fromNumber, read);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SmsProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" fromNumber: ").append(toIndentedString(fromNumber)).append("\n");
sb.append(" read: ").append(toIndentedString(read)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("body");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("phoneNumber");
openapiFields.add("fromNumber");
openapiFields.add("read");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("body");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("phoneNumber");
openapiRequiredFields.add("fromNumber");
openapiRequiredFields.add("read");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SmsProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SmsProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SmsProjection is not found in the empty JSON string", SmsProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SmsProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SmsProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("phoneNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString()));
}
if (!jsonObj.get("fromNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `fromNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromNumber").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SmsProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SmsProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SmsProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SmsProjection.class));
return (TypeAdapter<T>) new TypeAdapter<SmsProjection>() {
@Override
public void write(JsonWriter out, SmsProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SmsProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SmsProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of SmsProjection
* @throws IOException if the JSON string is invalid with respect to SmsProjection
*/
public static SmsProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SmsProjection.class);
}
/**
* Convert an instance of SmsProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* SmsPreview
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SmsPreview {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
private UUID phoneNumber;
public static final String SERIALIZED_NAME_FROM_NUMBER = "fromNumber";
@SerializedName(SERIALIZED_NAME_FROM_NUMBER)
private String fromNumber;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public SmsPreview() {
}
public SmsPreview id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public SmsPreview userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public SmsPreview body(String body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public SmsPreview phoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* Get phoneNumber
* @return phoneNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
}
public SmsPreview fromNumber(String fromNumber) {
this.fromNumber = fromNumber;
return this;
}
/**
* Get fromNumber
* @return fromNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getFromNumber() {
return fromNumber;
}
public void setFromNumber(String fromNumber) {
this.fromNumber = fromNumber;
}
public SmsPreview createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SmsPreview smsPreview = (SmsPreview) o;
return Objects.equals(this.id, smsPreview.id) &&
Objects.equals(this.userId, smsPreview.userId) &&
Objects.equals(this.body, smsPreview.body) &&
Objects.equals(this.phoneNumber, smsPreview.phoneNumber) &&
Objects.equals(this.fromNumber, smsPreview.fromNumber) &&
Objects.equals(this.createdAt, smsPreview.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, body, phoneNumber, fromNumber, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SmsPreview {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" fromNumber: ").append(toIndentedString(fromNumber)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("body");
openapiFields.add("phoneNumber");
openapiFields.add("fromNumber");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("body");
openapiRequiredFields.add("phoneNumber");
openapiRequiredFields.add("fromNumber");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SmsPreview
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SmsPreview.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SmsPreview is not found in the empty JSON string", SmsPreview.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SmsPreview.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsPreview` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SmsPreview.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if (!jsonObj.get("phoneNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString()));
}
if (!jsonObj.get("fromNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `fromNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromNumber").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SmsPreview.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SmsPreview' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SmsPreview> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SmsPreview.class));
return (TypeAdapter<T>) new TypeAdapter<SmsPreview>() {
@Override
public void write(JsonWriter out, SmsPreview value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SmsPreview read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SmsPreview given an JSON string
*
* @param jsonString JSON string
* @return An instance of SmsPreview
* @throws IOException if the JSON string is invalid with respect to SmsPreview
*/
public static SmsPreview fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SmsPreview.class);
}
/**
* Convert an instance of SmsPreview to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for matching SMS messages in a phone number. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `BODY` should `CONTAIN` value.
*/
@ApiModel(description = "Options for matching SMS messages in a phone number. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `BODY` should `CONTAIN` value.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SmsMatchOption {
/**
* Fields of an SMS object that can be used to filter results
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
BODY("BODY"),
FROM("FROM");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
/**
* How the value of the email field specified should be compared to the value given in the match options.
*/
@JsonAdapter(ShouldEnum.Adapter.class)
public enum ShouldEnum {
CONTAIN("CONTAIN"),
EQUAL("EQUAL");
private String value;
ShouldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ShouldEnum fromValue(String value) {
for (ShouldEnum b : ShouldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ShouldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ShouldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ShouldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ShouldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SHOULD = "should";
@SerializedName(SERIALIZED_NAME_SHOULD)
private ShouldEnum should;
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private String value;
public SmsMatchOption() {
}
public SmsMatchOption field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Fields of an SMS object that can be used to filter results
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Fields of an SMS object that can be used to filter results")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public SmsMatchOption should(ShouldEnum should) {
this.should = should;
return this;
}
/**
* How the value of the email field specified should be compared to the value given in the match options.
* @return should
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "How the value of the email field specified should be compared to the value given in the match options.")
public ShouldEnum getShould() {
return should;
}
public void setShould(ShouldEnum should) {
this.should = should;
}
public SmsMatchOption value(String value) {
this.value = value;
return this;
}
/**
* The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.
* @return value
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.")
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SmsMatchOption smsMatchOption = (SmsMatchOption) o;
return Objects.equals(this.field, smsMatchOption.field) &&
Objects.equals(this.should, smsMatchOption.should) &&
Objects.equals(this.value, smsMatchOption.value);
}
@Override
public int hashCode() {
return Objects.hash(field, should, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SmsMatchOption {\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" should: ").append(toIndentedString(should)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("field");
openapiFields.add("should");
openapiFields.add("value");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("field");
openapiRequiredFields.add("should");
openapiRequiredFields.add("value");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SmsMatchOption
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SmsMatchOption.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SmsMatchOption is not found in the empty JSON string", SmsMatchOption.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SmsMatchOption.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsMatchOption` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SmsMatchOption.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("should").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `should` to be a primitive type in the JSON string but got `%s`", jsonObj.get("should").toString()));
}
if (!jsonObj.get("value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SmsMatchOption.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SmsMatchOption' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SmsMatchOption> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SmsMatchOption.class));
return (TypeAdapter<T>) new TypeAdapter<SmsMatchOption>() {
@Override
public void write(JsonWriter out, SmsMatchOption value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SmsMatchOption read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SmsMatchOption given an JSON string
*
* @param jsonString JSON string
* @return An instance of SmsMatchOption
* @throws IOException if the JSON string is invalid with respect to SmsMatchOption
*/
public static SmsMatchOption fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SmsMatchOption.class);
}
/**
* Convert an instance of SmsMatchOption to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* SmsDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SmsDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
private UUID phoneNumber;
public static final String SERIALIZED_NAME_FROM_NUMBER = "fromNumber";
@SerializedName(SERIALIZED_NAME_FROM_NUMBER)
private String fromNumber;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_READ = "read";
@SerializedName(SERIALIZED_NAME_READ)
private Boolean read;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public SmsDto() {
}
public SmsDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public SmsDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public SmsDto phoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* Get phoneNumber
* @return phoneNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(UUID phoneNumber) {
this.phoneNumber = phoneNumber;
}
public SmsDto fromNumber(String fromNumber) {
this.fromNumber = fromNumber;
return this;
}
/**
* Get fromNumber
* @return fromNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getFromNumber() {
return fromNumber;
}
public void setFromNumber(String fromNumber) {
this.fromNumber = fromNumber;
}
public SmsDto body(String body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public SmsDto read(Boolean read) {
this.read = read;
return this;
}
/**
* Get read
* @return read
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getRead() {
return read;
}
public void setRead(Boolean read) {
this.read = read;
}
public SmsDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public SmsDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SmsDto smsDto = (SmsDto) o;
return Objects.equals(this.id, smsDto.id) &&
Objects.equals(this.userId, smsDto.userId) &&
Objects.equals(this.phoneNumber, smsDto.phoneNumber) &&
Objects.equals(this.fromNumber, smsDto.fromNumber) &&
Objects.equals(this.body, smsDto.body) &&
Objects.equals(this.read, smsDto.read) &&
Objects.equals(this.createdAt, smsDto.createdAt) &&
Objects.equals(this.updatedAt, smsDto.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, phoneNumber, fromNumber, body, read, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SmsDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" fromNumber: ").append(toIndentedString(fromNumber)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" read: ").append(toIndentedString(read)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("phoneNumber");
openapiFields.add("fromNumber");
openapiFields.add("body");
openapiFields.add("read");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("phoneNumber");
openapiRequiredFields.add("fromNumber");
openapiRequiredFields.add("body");
openapiRequiredFields.add("read");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SmsDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SmsDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SmsDto is not found in the empty JSON string", SmsDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SmsDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SmsDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("phoneNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString()));
}
if (!jsonObj.get("fromNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `fromNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromNumber").toString()));
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SmsDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SmsDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SmsDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SmsDto.class));
return (TypeAdapter<T>) new TypeAdapter<SmsDto>() {
@Override
public void write(JsonWriter out, SmsDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SmsDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SmsDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of SmsDto
* @throws IOException if the JSON string is invalid with respect to SmsDto
*/
public static SmsDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SmsDto.class);
}
/**
* Convert an instance of SmsDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Simplified send email options
*/
@ApiModel(description = "Simplified send email options")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SimpleSendEmailOptions {
public static final String SERIALIZED_NAME_SENDER_ID = "senderId";
@SerializedName(SERIALIZED_NAME_SENDER_ID)
private UUID senderId;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private String to;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public SimpleSendEmailOptions() {
}
public SimpleSendEmailOptions senderId(UUID senderId) {
this.senderId = senderId;
return this;
}
/**
* ID of inbox to send from. If null an inbox will be created for sending
* @return senderId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of inbox to send from. If null an inbox will be created for sending")
public UUID getSenderId() {
return senderId;
}
public void setSenderId(UUID senderId) {
this.senderId = senderId;
}
public SimpleSendEmailOptions to(String to) {
this.to = to;
return this;
}
/**
* Email address to send to
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Email address to send to")
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public SimpleSendEmailOptions body(String body) {
this.body = body;
return this;
}
/**
* Body of the email message. Supports HTML
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Body of the email message. Supports HTML")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public SimpleSendEmailOptions subject(String subject) {
this.subject = subject;
return this;
}
/**
* Subject line of the email
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Subject line of the email")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SimpleSendEmailOptions simpleSendEmailOptions = (SimpleSendEmailOptions) o;
return Objects.equals(this.senderId, simpleSendEmailOptions.senderId) &&
Objects.equals(this.to, simpleSendEmailOptions.to) &&
Objects.equals(this.body, simpleSendEmailOptions.body) &&
Objects.equals(this.subject, simpleSendEmailOptions.subject);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(senderId, to, body, subject);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SimpleSendEmailOptions {\n");
sb.append(" senderId: ").append(toIndentedString(senderId)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("senderId");
openapiFields.add("to");
openapiFields.add("body");
openapiFields.add("subject");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("to");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SimpleSendEmailOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SimpleSendEmailOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SimpleSendEmailOptions is not found in the empty JSON string", SimpleSendEmailOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SimpleSendEmailOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SimpleSendEmailOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SimpleSendEmailOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("senderId") != null && !jsonObj.get("senderId").isJsonNull()) && !jsonObj.get("senderId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `senderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("senderId").toString()));
}
if (!jsonObj.get("to").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SimpleSendEmailOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SimpleSendEmailOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SimpleSendEmailOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SimpleSendEmailOptions.class));
return (TypeAdapter<T>) new TypeAdapter<SimpleSendEmailOptions>() {
@Override
public void write(JsonWriter out, SimpleSendEmailOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SimpleSendEmailOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SimpleSendEmailOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of SimpleSendEmailOptions
* @throws IOException if the JSON string is invalid with respect to SimpleSendEmailOptions
*/
public static SimpleSendEmailOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SimpleSendEmailOptions.class);
}
/**
* Convert an instance of SimpleSendEmailOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for setting inbox favourite state
*/
@ApiModel(description = "Options for setting inbox favourite state")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SetInboxFavouritedOptions {
public static final String SERIALIZED_NAME_STATE = "state";
@SerializedName(SERIALIZED_NAME_STATE)
private Boolean state;
public SetInboxFavouritedOptions() {
}
public SetInboxFavouritedOptions state(Boolean state) {
this.state = state;
return this;
}
/**
* Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering
* @return state
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering")
public Boolean getState() {
return state;
}
public void setState(Boolean state) {
this.state = state;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SetInboxFavouritedOptions setInboxFavouritedOptions = (SetInboxFavouritedOptions) o;
return Objects.equals(this.state, setInboxFavouritedOptions.state);
}
@Override
public int hashCode() {
return Objects.hash(state);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SetInboxFavouritedOptions {\n");
sb.append(" state: ").append(toIndentedString(state)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("state");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("state");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SetInboxFavouritedOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SetInboxFavouritedOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SetInboxFavouritedOptions is not found in the empty JSON string", SetInboxFavouritedOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SetInboxFavouritedOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetInboxFavouritedOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SetInboxFavouritedOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SetInboxFavouritedOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SetInboxFavouritedOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SetInboxFavouritedOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SetInboxFavouritedOptions.class));
return (TypeAdapter<T>) new TypeAdapter<SetInboxFavouritedOptions>() {
@Override
public void write(JsonWriter out, SetInboxFavouritedOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SetInboxFavouritedOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SetInboxFavouritedOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of SetInboxFavouritedOptions
* @throws IOException if the JSON string is invalid with respect to SetInboxFavouritedOptions
*/
public static SetInboxFavouritedOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SetInboxFavouritedOptions.class);
}
/**
* Convert an instance of SetInboxFavouritedOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Collection of items
*/
@ApiModel(description = "Collection of items")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SentEmailProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = new ArrayList<>();
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = new ArrayList<>();
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = new ArrayList<>();
public static final String SERIALIZED_NAME_BODY_M_D5_HASH = "bodyMD5Hash";
@SerializedName(SERIALIZED_NAME_BODY_M_D5_HASH)
private String bodyMD5Hash;
public static final String SERIALIZED_NAME_VIRTUAL_SEND = "virtualSend";
@SerializedName(SERIALIZED_NAME_VIRTUAL_SEND)
private Boolean virtualSend;
public SentEmailProjection() {
}
public SentEmailProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public SentEmailProjection from(String from) {
this.from = from;
return this;
}
/**
* Get from
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public SentEmailProjection subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public SentEmailProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public SentEmailProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public SentEmailProjection attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public SentEmailProjection addAttachmentsItem(String attachmentsItem) {
this.attachments.add(attachmentsItem);
return this;
}
/**
* Get attachments
* @return attachments
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public SentEmailProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public SentEmailProjection to(List<String> to) {
this.to = to;
return this;
}
public SentEmailProjection addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* Get to
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public SentEmailProjection bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public SentEmailProjection addBccItem(String bccItem) {
this.bcc.add(bccItem);
return this;
}
/**
* Get bcc
* @return bcc
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public SentEmailProjection cc(List<String> cc) {
this.cc = cc;
return this;
}
public SentEmailProjection addCcItem(String ccItem) {
this.cc.add(ccItem);
return this;
}
/**
* Get cc
* @return cc
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public SentEmailProjection bodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
return this;
}
/**
* Get bodyMD5Hash
* @return bodyMD5Hash
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBodyMD5Hash() {
return bodyMD5Hash;
}
public void setBodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
}
public SentEmailProjection virtualSend(Boolean virtualSend) {
this.virtualSend = virtualSend;
return this;
}
/**
* Get virtualSend
* @return virtualSend
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getVirtualSend() {
return virtualSend;
}
public void setVirtualSend(Boolean virtualSend) {
this.virtualSend = virtualSend;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SentEmailProjection sentEmailProjection = (SentEmailProjection) o;
return Objects.equals(this.id, sentEmailProjection.id) &&
Objects.equals(this.from, sentEmailProjection.from) &&
Objects.equals(this.subject, sentEmailProjection.subject) &&
Objects.equals(this.inboxId, sentEmailProjection.inboxId) &&
Objects.equals(this.userId, sentEmailProjection.userId) &&
Objects.equals(this.attachments, sentEmailProjection.attachments) &&
Objects.equals(this.createdAt, sentEmailProjection.createdAt) &&
Objects.equals(this.to, sentEmailProjection.to) &&
Objects.equals(this.bcc, sentEmailProjection.bcc) &&
Objects.equals(this.cc, sentEmailProjection.cc) &&
Objects.equals(this.bodyMD5Hash, sentEmailProjection.bodyMD5Hash) &&
Objects.equals(this.virtualSend, sentEmailProjection.virtualSend);
}
@Override
public int hashCode() {
return Objects.hash(id, from, subject, inboxId, userId, attachments, createdAt, to, bcc, cc, bodyMD5Hash, virtualSend);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SentEmailProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bodyMD5Hash: ").append(toIndentedString(bodyMD5Hash)).append("\n");
sb.append(" virtualSend: ").append(toIndentedString(virtualSend)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("from");
openapiFields.add("subject");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("attachments");
openapiFields.add("createdAt");
openapiFields.add("to");
openapiFields.add("bcc");
openapiFields.add("cc");
openapiFields.add("bodyMD5Hash");
openapiFields.add("virtualSend");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("attachments");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("to");
openapiRequiredFields.add("bcc");
openapiRequiredFields.add("cc");
openapiRequiredFields.add("virtualSend");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SentEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SentEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SentEmailProjection is not found in the empty JSON string", SentEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SentEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SentEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SentEmailProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
// ensure the required json array is present
if (jsonObj.get("attachments") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
// ensure the required json array is present
if (jsonObj.get("bcc") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the required json array is present
if (jsonObj.get("cc") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
if ((jsonObj.get("bodyMD5Hash") != null && !jsonObj.get("bodyMD5Hash").isJsonNull()) && !jsonObj.get("bodyMD5Hash").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyMD5Hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyMD5Hash").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SentEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SentEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SentEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SentEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<SentEmailProjection>() {
@Override
public void write(JsonWriter out, SentEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SentEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SentEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of SentEmailProjection
* @throws IOException if the JSON string is invalid with respect to SentEmailProjection
*/
public static SentEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SentEmailProjection.class);
}
/**
* Convert an instance of SentEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Sent email details
*/
@ApiModel(description = "Sent email details")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SentEmailDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = null;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_BODY_M_D5_HASH = "bodyMD5Hash";
@SerializedName(SERIALIZED_NAME_BODY_M_D5_HASH)
private String bodyMD5Hash;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_TO_CONTACTS = "toContacts";
@SerializedName(SERIALIZED_NAME_TO_CONTACTS)
private List<UUID> toContacts = null;
public static final String SERIALIZED_NAME_TO_GROUP = "toGroup";
@SerializedName(SERIALIZED_NAME_TO_GROUP)
private UUID toGroup;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_SENT_AT = "sentAt";
@SerializedName(SERIALIZED_NAME_SENT_AT)
private OffsetDateTime sentAt;
public static final String SERIALIZED_NAME_PIXEL_IDS = "pixelIds";
@SerializedName(SERIALIZED_NAME_PIXEL_IDS)
private List<UUID> pixelIds = null;
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_MESSAGE_IDS = "messageIds";
@SerializedName(SERIALIZED_NAME_MESSAGE_IDS)
private List<String> messageIds = null;
public static final String SERIALIZED_NAME_VIRTUAL_SEND = "virtualSend";
@SerializedName(SERIALIZED_NAME_VIRTUAL_SEND)
private Boolean virtualSend;
public static final String SERIALIZED_NAME_TEMPLATE_ID = "templateId";
@SerializedName(SERIALIZED_NAME_TEMPLATE_ID)
private UUID templateId;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private Boolean html;
public SentEmailDto() {
}
public SentEmailDto id(UUID id) {
this.id = id;
return this;
}
/**
* ID of sent email
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of sent email")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public SentEmailDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* User ID
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "User ID")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public SentEmailDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Inbox ID email was sent from
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inbox ID email was sent from")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public SentEmailDto domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* Domain ID
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Domain ID")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public SentEmailDto to(List<String> to) {
this.to = to;
return this;
}
public SentEmailDto addToItem(String toItem) {
if (this.to == null) {
this.to = new ArrayList<>();
}
this.to.add(toItem);
return this;
}
/**
* Recipients email was sent to
* @return to
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Recipients email was sent to")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public SentEmailDto from(String from) {
this.from = from;
return this;
}
/**
* Sent from address
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Sent from address")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public SentEmailDto replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* Get replyTo
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public SentEmailDto cc(List<String> cc) {
this.cc = cc;
return this;
}
public SentEmailDto addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* Get cc
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public SentEmailDto bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public SentEmailDto addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* Get bcc
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public SentEmailDto attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public SentEmailDto addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* Array of IDs of attachments that were sent with this email
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Array of IDs of attachments that were sent with this email")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public SentEmailDto subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public SentEmailDto bodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
return this;
}
/**
* MD5 Hash
* @return bodyMD5Hash
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "MD5 Hash")
public String getBodyMD5Hash() {
return bodyMD5Hash;
}
public void setBodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
}
public SentEmailDto body(String body) {
this.body = body;
return this;
}
/**
* Sent email body
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Sent email body")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public SentEmailDto toContacts(List<UUID> toContacts) {
this.toContacts = toContacts;
return this;
}
public SentEmailDto addToContactsItem(UUID toContactsItem) {
if (this.toContacts == null) {
this.toContacts = new ArrayList<>();
}
this.toContacts.add(toContactsItem);
return this;
}
/**
* Get toContacts
* @return toContacts
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<UUID> getToContacts() {
return toContacts;
}
public void setToContacts(List<UUID> toContacts) {
this.toContacts = toContacts;
}
public SentEmailDto toGroup(UUID toGroup) {
this.toGroup = toGroup;
return this;
}
/**
* Get toGroup
* @return toGroup
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getToGroup() {
return toGroup;
}
public void setToGroup(UUID toGroup) {
this.toGroup = toGroup;
}
public SentEmailDto charset(String charset) {
this.charset = charset;
return this;
}
/**
* Get charset
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public SentEmailDto isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Get isHTML
* @return isHTML
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public SentEmailDto sentAt(OffsetDateTime sentAt) {
this.sentAt = sentAt;
return this;
}
/**
* Get sentAt
* @return sentAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getSentAt() {
return sentAt;
}
public void setSentAt(OffsetDateTime sentAt) {
this.sentAt = sentAt;
}
public SentEmailDto pixelIds(List<UUID> pixelIds) {
this.pixelIds = pixelIds;
return this;
}
public SentEmailDto addPixelIdsItem(UUID pixelIdsItem) {
if (this.pixelIds == null) {
this.pixelIds = new ArrayList<>();
}
this.pixelIds.add(pixelIdsItem);
return this;
}
/**
* Get pixelIds
* @return pixelIds
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<UUID> getPixelIds() {
return pixelIds;
}
public void setPixelIds(List<UUID> pixelIds) {
this.pixelIds = pixelIds;
}
public SentEmailDto messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Get messageId
* @return messageId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public SentEmailDto messageIds(List<String> messageIds) {
this.messageIds = messageIds;
return this;
}
public SentEmailDto addMessageIdsItem(String messageIdsItem) {
if (this.messageIds == null) {
this.messageIds = new ArrayList<>();
}
this.messageIds.add(messageIdsItem);
return this;
}
/**
* Get messageIds
* @return messageIds
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getMessageIds() {
return messageIds;
}
public void setMessageIds(List<String> messageIds) {
this.messageIds = messageIds;
}
public SentEmailDto virtualSend(Boolean virtualSend) {
this.virtualSend = virtualSend;
return this;
}
/**
* Get virtualSend
* @return virtualSend
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getVirtualSend() {
return virtualSend;
}
public void setVirtualSend(Boolean virtualSend) {
this.virtualSend = virtualSend;
}
public SentEmailDto templateId(UUID templateId) {
this.templateId = templateId;
return this;
}
/**
* Get templateId
* @return templateId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getTemplateId() {
return templateId;
}
public void setTemplateId(UUID templateId) {
this.templateId = templateId;
}
public SentEmailDto templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public SentEmailDto putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Get templateVariables
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
public SentEmailDto html(Boolean html) {
this.html = html;
return this;
}
/**
* Get html
* @return html
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getHtml() {
return html;
}
public void setHtml(Boolean html) {
this.html = html;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SentEmailDto sentEmailDto = (SentEmailDto) o;
return Objects.equals(this.id, sentEmailDto.id) &&
Objects.equals(this.userId, sentEmailDto.userId) &&
Objects.equals(this.inboxId, sentEmailDto.inboxId) &&
Objects.equals(this.domainId, sentEmailDto.domainId) &&
Objects.equals(this.to, sentEmailDto.to) &&
Objects.equals(this.from, sentEmailDto.from) &&
Objects.equals(this.replyTo, sentEmailDto.replyTo) &&
Objects.equals(this.cc, sentEmailDto.cc) &&
Objects.equals(this.bcc, sentEmailDto.bcc) &&
Objects.equals(this.attachments, sentEmailDto.attachments) &&
Objects.equals(this.subject, sentEmailDto.subject) &&
Objects.equals(this.bodyMD5Hash, sentEmailDto.bodyMD5Hash) &&
Objects.equals(this.body, sentEmailDto.body) &&
Objects.equals(this.toContacts, sentEmailDto.toContacts) &&
Objects.equals(this.toGroup, sentEmailDto.toGroup) &&
Objects.equals(this.charset, sentEmailDto.charset) &&
Objects.equals(this.isHTML, sentEmailDto.isHTML) &&
Objects.equals(this.sentAt, sentEmailDto.sentAt) &&
Objects.equals(this.pixelIds, sentEmailDto.pixelIds) &&
Objects.equals(this.messageId, sentEmailDto.messageId) &&
Objects.equals(this.messageIds, sentEmailDto.messageIds) &&
Objects.equals(this.virtualSend, sentEmailDto.virtualSend) &&
Objects.equals(this.templateId, sentEmailDto.templateId) &&
Objects.equals(this.templateVariables, sentEmailDto.templateVariables) &&
Objects.equals(this.html, sentEmailDto.html);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, inboxId, domainId, to, from, replyTo, cc, bcc, attachments, subject, bodyMD5Hash, body, toContacts, toGroup, charset, isHTML, sentAt, pixelIds, messageId, messageIds, virtualSend, templateId, templateVariables, html);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SentEmailDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" bodyMD5Hash: ").append(toIndentedString(bodyMD5Hash)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" toContacts: ").append(toIndentedString(toContacts)).append("\n");
sb.append(" toGroup: ").append(toIndentedString(toGroup)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n");
sb.append(" pixelIds: ").append(toIndentedString(pixelIds)).append("\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" messageIds: ").append(toIndentedString(messageIds)).append("\n");
sb.append(" virtualSend: ").append(toIndentedString(virtualSend)).append("\n");
sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("inboxId");
openapiFields.add("domainId");
openapiFields.add("to");
openapiFields.add("from");
openapiFields.add("replyTo");
openapiFields.add("cc");
openapiFields.add("bcc");
openapiFields.add("attachments");
openapiFields.add("subject");
openapiFields.add("bodyMD5Hash");
openapiFields.add("body");
openapiFields.add("toContacts");
openapiFields.add("toGroup");
openapiFields.add("charset");
openapiFields.add("isHTML");
openapiFields.add("sentAt");
openapiFields.add("pixelIds");
openapiFields.add("messageId");
openapiFields.add("messageIds");
openapiFields.add("virtualSend");
openapiFields.add("templateId");
openapiFields.add("templateVariables");
openapiFields.add("html");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("sentAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SentEmailDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SentEmailDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SentEmailDto is not found in the empty JSON string", SentEmailDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SentEmailDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SentEmailDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SentEmailDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("bodyMD5Hash") != null && !jsonObj.get("bodyMD5Hash").isJsonNull()) && !jsonObj.get("bodyMD5Hash").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyMD5Hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyMD5Hash").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("toContacts") != null && !jsonObj.get("toContacts").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `toContacts` to be an array in the JSON string but got `%s`", jsonObj.get("toContacts").toString()));
}
if ((jsonObj.get("toGroup") != null && !jsonObj.get("toGroup").isJsonNull()) && !jsonObj.get("toGroup").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `toGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toGroup").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("pixelIds") != null && !jsonObj.get("pixelIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `pixelIds` to be an array in the JSON string but got `%s`", jsonObj.get("pixelIds").toString()));
}
if ((jsonObj.get("messageId") != null && !jsonObj.get("messageId").isJsonNull()) && !jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("messageIds") != null && !jsonObj.get("messageIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `messageIds` to be an array in the JSON string but got `%s`", jsonObj.get("messageIds").toString()));
}
if ((jsonObj.get("templateId") != null && !jsonObj.get("templateId").isJsonNull()) && !jsonObj.get("templateId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `templateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SentEmailDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SentEmailDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SentEmailDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SentEmailDto.class));
return (TypeAdapter<T>) new TypeAdapter<SentEmailDto>() {
@Override
public void write(JsonWriter out, SentEmailDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SentEmailDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SentEmailDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of SentEmailDto
* @throws IOException if the JSON string is invalid with respect to SentEmailDto
*/
public static SentEmailDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SentEmailDto.class);
}
/**
* Convert an instance of SentEmailDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Sender object containing from email address and from personal name if provided in address
*/
@ApiModel(description = "Sender object containing from email address and from personal name if provided in address")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Sender {
public static final String SERIALIZED_NAME_RAW_VALUE = "rawValue";
@SerializedName(SERIALIZED_NAME_RAW_VALUE)
private String rawValue;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public Sender() {
}
public Sender rawValue(String rawValue) {
this.rawValue = rawValue;
return this;
}
/**
* Get rawValue
* @return rawValue
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRawValue() {
return rawValue;
}
public void setRawValue(String rawValue) {
this.rawValue = rawValue;
}
public Sender emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public Sender name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Sender sender = (Sender) o;
return Objects.equals(this.rawValue, sender.rawValue) &&
Objects.equals(this.emailAddress, sender.emailAddress) &&
Objects.equals(this.name, sender.name);
}
@Override
public int hashCode() {
return Objects.hash(rawValue, emailAddress, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Sender {\n");
sb.append(" rawValue: ").append(toIndentedString(rawValue)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("rawValue");
openapiFields.add("emailAddress");
openapiFields.add("name");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("rawValue");
openapiRequiredFields.add("emailAddress");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to Sender
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!Sender.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Sender is not found in the empty JSON string", Sender.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!Sender.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Sender` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Sender.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("rawValue").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `rawValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawValue").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!Sender.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'Sender' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Sender> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(Sender.class));
return (TypeAdapter<T>) new TypeAdapter<Sender>() {
@Override
public void write(JsonWriter out, Sender value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public Sender read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of Sender given an JSON string
*
* @param jsonString JSON string
* @return An instance of Sender
* @throws IOException if the JSON string is invalid with respect to Sender
*/
public static Sender fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Sender.class);
}
/**
* Convert an instance of Sender to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Collection of items
*/
@ApiModel(description = "Collection of items")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SendWithQueueResult {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_HEADER_ID = "headerId";
@SerializedName(SERIALIZED_NAME_HEADER_ID)
private String headerId;
public static final String SERIALIZED_NAME_DELIVERED = "delivered";
@SerializedName(SERIALIZED_NAME_DELIVERED)
private Boolean delivered;
public static final String SERIALIZED_NAME_EXCEPTION_NAME = "exceptionName";
@SerializedName(SERIALIZED_NAME_EXCEPTION_NAME)
private String exceptionName;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public SendWithQueueResult() {
}
public SendWithQueueResult id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public SendWithQueueResult userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public SendWithQueueResult subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public SendWithQueueResult inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public SendWithQueueResult headerId(String headerId) {
this.headerId = headerId;
return this;
}
/**
* Get headerId
* @return headerId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getHeaderId() {
return headerId;
}
public void setHeaderId(String headerId) {
this.headerId = headerId;
}
public SendWithQueueResult delivered(Boolean delivered) {
this.delivered = delivered;
return this;
}
/**
* Get delivered
* @return delivered
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getDelivered() {
return delivered;
}
public void setDelivered(Boolean delivered) {
this.delivered = delivered;
}
public SendWithQueueResult exceptionName(String exceptionName) {
this.exceptionName = exceptionName;
return this;
}
/**
* Get exceptionName
* @return exceptionName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getExceptionName() {
return exceptionName;
}
public void setExceptionName(String exceptionName) {
this.exceptionName = exceptionName;
}
public SendWithQueueResult message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public SendWithQueueResult createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public SendWithQueueResult updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SendWithQueueResult sendWithQueueResult = (SendWithQueueResult) o;
return Objects.equals(this.id, sendWithQueueResult.id) &&
Objects.equals(this.userId, sendWithQueueResult.userId) &&
Objects.equals(this.subject, sendWithQueueResult.subject) &&
Objects.equals(this.inboxId, sendWithQueueResult.inboxId) &&
Objects.equals(this.headerId, sendWithQueueResult.headerId) &&
Objects.equals(this.delivered, sendWithQueueResult.delivered) &&
Objects.equals(this.exceptionName, sendWithQueueResult.exceptionName) &&
Objects.equals(this.message, sendWithQueueResult.message) &&
Objects.equals(this.createdAt, sendWithQueueResult.createdAt) &&
Objects.equals(this.updatedAt, sendWithQueueResult.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, subject, inboxId, headerId, delivered, exceptionName, message, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SendWithQueueResult {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" headerId: ").append(toIndentedString(headerId)).append("\n");
sb.append(" delivered: ").append(toIndentedString(delivered)).append("\n");
sb.append(" exceptionName: ").append(toIndentedString(exceptionName)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("subject");
openapiFields.add("inboxId");
openapiFields.add("headerId");
openapiFields.add("delivered");
openapiFields.add("exceptionName");
openapiFields.add("message");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("headerId");
openapiRequiredFields.add("delivered");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SendWithQueueResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SendWithQueueResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SendWithQueueResult is not found in the empty JSON string", SendWithQueueResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SendWithQueueResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SendWithQueueResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SendWithQueueResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("headerId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `headerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("headerId").toString()));
}
if ((jsonObj.get("exceptionName") != null && !jsonObj.get("exceptionName").isJsonNull()) && !jsonObj.get("exceptionName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `exceptionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exceptionName").toString()));
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SendWithQueueResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SendWithQueueResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SendWithQueueResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SendWithQueueResult.class));
return (TypeAdapter<T>) new TypeAdapter<SendWithQueueResult>() {
@Override
public void write(JsonWriter out, SendWithQueueResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SendWithQueueResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SendWithQueueResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of SendWithQueueResult
* @throws IOException if the JSON string is invalid with respect to SendWithQueueResult
*/
public static SendWithQueueResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SendWithQueueResult.class);
}
/**
* Convert an instance of SendWithQueueResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for the email envelope
*/
@ApiModel(description = "Options for the email envelope")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SendSMTPEnvelopeOptions {
public static final String SERIALIZED_NAME_RCPT_TO = "rcptTo";
@SerializedName(SERIALIZED_NAME_RCPT_TO)
private List<String> rcptTo = new ArrayList<>();
public static final String SERIALIZED_NAME_MAIL_FROM = "mailFrom";
@SerializedName(SERIALIZED_NAME_MAIL_FROM)
private String mailFrom;
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
private String data;
public SendSMTPEnvelopeOptions() {
}
public SendSMTPEnvelopeOptions rcptTo(List<String> rcptTo) {
this.rcptTo = rcptTo;
return this;
}
public SendSMTPEnvelopeOptions addRcptToItem(String rcptToItem) {
this.rcptTo.add(rcptToItem);
return this;
}
/**
* Get rcptTo
* @return rcptTo
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getRcptTo() {
return rcptTo;
}
public void setRcptTo(List<String> rcptTo) {
this.rcptTo = rcptTo;
}
public SendSMTPEnvelopeOptions mailFrom(String mailFrom) {
this.mailFrom = mailFrom;
return this;
}
/**
* Get mailFrom
* @return mailFrom
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getMailFrom() {
return mailFrom;
}
public void setMailFrom(String mailFrom) {
this.mailFrom = mailFrom;
}
public SendSMTPEnvelopeOptions data(String data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SendSMTPEnvelopeOptions sendSMTPEnvelopeOptions = (SendSMTPEnvelopeOptions) o;
return Objects.equals(this.rcptTo, sendSMTPEnvelopeOptions.rcptTo) &&
Objects.equals(this.mailFrom, sendSMTPEnvelopeOptions.mailFrom) &&
Objects.equals(this.data, sendSMTPEnvelopeOptions.data);
}
@Override
public int hashCode() {
return Objects.hash(rcptTo, mailFrom, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SendSMTPEnvelopeOptions {\n");
sb.append(" rcptTo: ").append(toIndentedString(rcptTo)).append("\n");
sb.append(" mailFrom: ").append(toIndentedString(mailFrom)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("rcptTo");
openapiFields.add("mailFrom");
openapiFields.add("data");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("rcptTo");
openapiRequiredFields.add("mailFrom");
openapiRequiredFields.add("data");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SendSMTPEnvelopeOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SendSMTPEnvelopeOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SendSMTPEnvelopeOptions is not found in the empty JSON string", SendSMTPEnvelopeOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SendSMTPEnvelopeOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SendSMTPEnvelopeOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : SendSMTPEnvelopeOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("rcptTo") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("rcptTo").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `rcptTo` to be an array in the JSON string but got `%s`", jsonObj.get("rcptTo").toString()));
}
if (!jsonObj.get("mailFrom").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `mailFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mailFrom").toString()));
}
if (!jsonObj.get("data").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SendSMTPEnvelopeOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SendSMTPEnvelopeOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SendSMTPEnvelopeOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SendSMTPEnvelopeOptions.class));
return (TypeAdapter<T>) new TypeAdapter<SendSMTPEnvelopeOptions>() {
@Override
public void write(JsonWriter out, SendSMTPEnvelopeOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SendSMTPEnvelopeOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SendSMTPEnvelopeOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of SendSMTPEnvelopeOptions
* @throws IOException if the JSON string is invalid with respect to SendSMTPEnvelopeOptions
*/
public static SendSMTPEnvelopeOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SendSMTPEnvelopeOptions.class);
}
/**
* Convert an instance of SendSMTPEnvelopeOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for the email to be sent
*/
@ApiModel(description = "Options for the email to be sent")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class SendEmailOptions {
public static final String SERIALIZED_NAME_TO_CONTACTS = "toContacts";
@SerializedName(SERIALIZED_NAME_TO_CONTACTS)
private List<UUID> toContacts = null;
public static final String SERIALIZED_NAME_TO_GROUP = "toGroup";
@SerializedName(SERIALIZED_NAME_TO_GROUP)
private UUID toGroup;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = null;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private Boolean html;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public static final String SERIALIZED_NAME_TEMPLATE = "template";
@SerializedName(SERIALIZED_NAME_TEMPLATE)
private UUID template;
/**
* How an email should be sent based on its recipients
*/
@JsonAdapter(SendStrategyEnum.Adapter.class)
public enum SendStrategyEnum {
SINGLE_MESSAGE("SINGLE_MESSAGE");
private String value;
SendStrategyEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SendStrategyEnum fromValue(String value) {
for (SendStrategyEnum b : SendStrategyEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<SendStrategyEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SendStrategyEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SendStrategyEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SendStrategyEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SEND_STRATEGY = "sendStrategy";
@SerializedName(SERIALIZED_NAME_SEND_STRATEGY)
private SendStrategyEnum sendStrategy;
public static final String SERIALIZED_NAME_USE_INBOX_NAME = "useInboxName";
@SerializedName(SERIALIZED_NAME_USE_INBOX_NAME)
private Boolean useInboxName;
public static final String SERIALIZED_NAME_ADD_TRACKING_PIXEL = "addTrackingPixel";
@SerializedName(SERIALIZED_NAME_ADD_TRACKING_PIXEL)
private Boolean addTrackingPixel;
public static final String SERIALIZED_NAME_FILTER_BOUNCED_RECIPIENTS = "filterBouncedRecipients";
@SerializedName(SERIALIZED_NAME_FILTER_BOUNCED_RECIPIENTS)
private Boolean filterBouncedRecipients;
/**
* Validate recipient email addresses before sending
*/
@JsonAdapter(ValidateEmailAddressesEnum.Adapter.class)
public enum ValidateEmailAddressesEnum {
VALIDATE_FILTER_REMOVE_INVALID("VALIDATE_FILTER_REMOVE_INVALID"),
VALIDATE_ERROR_IF_INVALID("VALIDATE_ERROR_IF_INVALID"),
NO_VALIDATION("NO_VALIDATION");
private String value;
ValidateEmailAddressesEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ValidateEmailAddressesEnum fromValue(String value) {
for (ValidateEmailAddressesEnum b : ValidateEmailAddressesEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<ValidateEmailAddressesEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ValidateEmailAddressesEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ValidateEmailAddressesEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ValidateEmailAddressesEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_VALIDATE_EMAIL_ADDRESSES = "validateEmailAddresses";
@SerializedName(SERIALIZED_NAME_VALIDATE_EMAIL_ADDRESSES)
private ValidateEmailAddressesEnum validateEmailAddresses;
public SendEmailOptions() {
}
public SendEmailOptions toContacts(List<UUID> toContacts) {
this.toContacts = toContacts;
return this;
}
public SendEmailOptions addToContactsItem(UUID toContactsItem) {
if (this.toContacts == null) {
this.toContacts = new ArrayList<>();
}
this.toContacts.add(toContactsItem);
return this;
}
/**
* Optional list of contact IDs to send email to. Manage your contacts via the API or dashboard. When contacts are used the email is sent to each contact separately so they will not see other recipients.
* @return toContacts
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional list of contact IDs to send email to. Manage your contacts via the API or dashboard. When contacts are used the email is sent to each contact separately so they will not see other recipients.")
public List<UUID> getToContacts() {
return toContacts;
}
public void setToContacts(List<UUID> toContacts) {
this.toContacts = toContacts;
}
public SendEmailOptions toGroup(UUID toGroup) {
this.toGroup = toGroup;
return this;
}
/**
* Optional contact group ID to send email to. You can create contacts and contact groups in the API or dashboard and use them for email campaigns. When contact groups are used the email is sent to each contact separately so they will not see other recipients
* @return toGroup
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional contact group ID to send email to. You can create contacts and contact groups in the API or dashboard and use them for email campaigns. When contact groups are used the email is sent to each contact separately so they will not see other recipients")
public UUID getToGroup() {
return toGroup;
}
public void setToGroup(UUID toGroup) {
this.toGroup = toGroup;
}
public SendEmailOptions to(List<String> to) {
this.to = to;
return this;
}
public SendEmailOptions addToItem(String toItem) {
if (this.to == null) {
this.to = new ArrayList<>();
}
this.to.add(toItem);
return this;
}
/**
* List of destination email addresses. Each email address must be RFC 5322 format. Even single recipients must be in array form. Maximum recipients per email depends on your plan. If you need to send many emails try using contacts or contact groups or use a non standard sendStrategy to ensure that spam filters are not triggered (many recipients in one email can affect your spam rating). Be cautious when sending emails that your recipients exist. High bounce rates (meaning a high percentage of emails cannot be delivered because an address does not exist) can result in account freezing.
* @return to
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of destination email addresses. Each email address must be RFC 5322 format. Even single recipients must be in array form. Maximum recipients per email depends on your plan. If you need to send many emails try using contacts or contact groups or use a non standard sendStrategy to ensure that spam filters are not triggered (many recipients in one email can affect your spam rating). Be cautious when sending emails that your recipients exist. High bounce rates (meaning a high percentage of emails cannot be delivered because an address does not exist) can result in account freezing.")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public SendEmailOptions from(String from) {
this.from = from;
return this;
}
/**
* Optional from address. Email address is RFC 5322 format and may include a display name and email in angle brackets (`my@address.com` or `My inbox <my@address.com>`). If no sender is set the source inbox address will be used for this field. If you set `useInboxName` to `true` the from field will include the inbox name as a display name: `inbox_name <inbox@address.com>`. For this to work use the name field when creating an inbox. Beware of potential spam penalties when setting the from field to an address not used by the inbox. Your emails may get blocked by services if you impersonate another address. To use a custom email addresses use a custom domain. You can create domains with the DomainController. The domain must be verified in the dashboard before it can be used.
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional from address. Email address is RFC 5322 format and may include a display name and email in angle brackets (`my@address.com` or `My inbox <my@address.com>`). If no sender is set the source inbox address will be used for this field. If you set `useInboxName` to `true` the from field will include the inbox name as a display name: `inbox_name <inbox@address.com>`. For this to work use the name field when creating an inbox. Beware of potential spam penalties when setting the from field to an address not used by the inbox. Your emails may get blocked by services if you impersonate another address. To use a custom email addresses use a custom domain. You can create domains with the DomainController. The domain must be verified in the dashboard before it can be used.")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public SendEmailOptions cc(List<String> cc) {
this.cc = cc;
return this;
}
public SendEmailOptions addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* Optional list of cc destination email addresses
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional list of cc destination email addresses")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public SendEmailOptions bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public SendEmailOptions addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* Optional list of bcc destination email addresses
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional list of bcc destination email addresses")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public SendEmailOptions subject(String subject) {
this.subject = subject;
return this;
}
/**
* Optional email subject line
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional email subject line")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public SendEmailOptions replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* Optional replyTo header
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional replyTo header")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public SendEmailOptions body(String body) {
this.body = body;
return this;
}
/**
* Optional contents of email. If body contains HTML then set `isHTML` to true to ensure that email clients render it correctly. You can use moustache template syntax in the email body in conjunction with `toGroup` contact variables or `templateVariables` data. If you need more templating control consider creating a template and using the `template` property instead of the body.
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional contents of email. If body contains HTML then set `isHTML` to true to ensure that email clients render it correctly. You can use moustache template syntax in the email body in conjunction with `toGroup` contact variables or `templateVariables` data. If you need more templating control consider creating a template and using the `template` property instead of the body.")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public SendEmailOptions html(Boolean html) {
this.html = html;
return this;
}
/**
* Optional HTML flag to indicate that contents is HTML. Set's a `content-type: text/html` for email. (Deprecated: use `isHTML` instead.)
* @return html
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional HTML flag to indicate that contents is HTML. Set's a `content-type: text/html` for email. (Deprecated: use `isHTML` instead.)")
public Boolean getHtml() {
return html;
}
public void setHtml(Boolean html) {
this.html = html;
}
public SendEmailOptions isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Optional HTML flag. If true the `content-type` of the email will be `text/html`. Set to true when sending HTML to ensure proper rending on email clients
* @return isHTML
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional HTML flag. If true the `content-type` of the email will be `text/html`. Set to true when sending HTML to ensure proper rending on email clients")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public SendEmailOptions charset(String charset) {
this.charset = charset;
return this;
}
/**
* Optional charset
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional charset")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public SendEmailOptions attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public SendEmailOptions addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* Optional list of attachment IDs to send with this email. You must first upload each attachment separately via method call or dashboard in order to obtain attachment IDs. This way you can reuse attachments with different emails once uploaded. There are several ways to upload that support `multi-part form`, `base64 file encoding`, and octet stream binary uploads. See the `UploadController` for available methods.
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional list of attachment IDs to send with this email. You must first upload each attachment separately via method call or dashboard in order to obtain attachment IDs. This way you can reuse attachments with different emails once uploaded. There are several ways to upload that support `multi-part form`, `base64 file encoding`, and octet stream binary uploads. See the `UploadController` for available methods. ")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public SendEmailOptions templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public SendEmailOptions putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Optional map of template variables. Will replace moustache syntax variables in subject and body or template with the associated values if found.
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional map of template variables. Will replace moustache syntax variables in subject and body or template with the associated values if found.")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
public SendEmailOptions template(UUID template) {
this.template = template;
return this;
}
/**
* Optional template ID to use for body. Will override body if provided. When using a template make sure you pass the corresponding map of `templateVariables`. You can find which variables are needed by fetching the template itself or viewing it in the dashboard.
* @return template
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional template ID to use for body. Will override body if provided. When using a template make sure you pass the corresponding map of `templateVariables`. You can find which variables are needed by fetching the template itself or viewing it in the dashboard.")
public UUID getTemplate() {
return template;
}
public void setTemplate(UUID template) {
this.template = template;
}
public SendEmailOptions sendStrategy(SendStrategyEnum sendStrategy) {
this.sendStrategy = sendStrategy;
return this;
}
/**
* How an email should be sent based on its recipients
* @return sendStrategy
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "How an email should be sent based on its recipients")
public SendStrategyEnum getSendStrategy() {
return sendStrategy;
}
public void setSendStrategy(SendStrategyEnum sendStrategy) {
this.sendStrategy = sendStrategy;
}
public SendEmailOptions useInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
return this;
}
/**
* Use name of inbox as sender email address name. Will construct RFC 5322 email address with `Inbox name <inbox@address.com>` if the inbox has a name.
* @return useInboxName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Use name of inbox as sender email address name. Will construct RFC 5322 email address with `Inbox name <inbox@address.com>` if the inbox has a name.")
public Boolean getUseInboxName() {
return useInboxName;
}
public void setUseInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
}
public SendEmailOptions addTrackingPixel(Boolean addTrackingPixel) {
this.addTrackingPixel = addTrackingPixel;
return this;
}
/**
* Add tracking pixel to email
* @return addTrackingPixel
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Add tracking pixel to email")
public Boolean getAddTrackingPixel() {
return addTrackingPixel;
}
public void setAddTrackingPixel(Boolean addTrackingPixel) {
this.addTrackingPixel = addTrackingPixel;
}
public SendEmailOptions filterBouncedRecipients(Boolean filterBouncedRecipients) {
this.filterBouncedRecipients = filterBouncedRecipients;
return this;
}
/**
* Filter recipients to remove any bounced recipients from to, bcc, and cc before sending
* @return filterBouncedRecipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter recipients to remove any bounced recipients from to, bcc, and cc before sending")
public Boolean getFilterBouncedRecipients() {
return filterBouncedRecipients;
}
public void setFilterBouncedRecipients(Boolean filterBouncedRecipients) {
this.filterBouncedRecipients = filterBouncedRecipients;
}
public SendEmailOptions validateEmailAddresses(ValidateEmailAddressesEnum validateEmailAddresses) {
this.validateEmailAddresses = validateEmailAddresses;
return this;
}
/**
* Validate recipient email addresses before sending
* @return validateEmailAddresses
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Validate recipient email addresses before sending")
public ValidateEmailAddressesEnum getValidateEmailAddresses() {
return validateEmailAddresses;
}
public void setValidateEmailAddresses(ValidateEmailAddressesEnum validateEmailAddresses) {
this.validateEmailAddresses = validateEmailAddresses;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SendEmailOptions sendEmailOptions = (SendEmailOptions) o;
return Objects.equals(this.toContacts, sendEmailOptions.toContacts) &&
Objects.equals(this.toGroup, sendEmailOptions.toGroup) &&
Objects.equals(this.to, sendEmailOptions.to) &&
Objects.equals(this.from, sendEmailOptions.from) &&
Objects.equals(this.cc, sendEmailOptions.cc) &&
Objects.equals(this.bcc, sendEmailOptions.bcc) &&
Objects.equals(this.subject, sendEmailOptions.subject) &&
Objects.equals(this.replyTo, sendEmailOptions.replyTo) &&
Objects.equals(this.body, sendEmailOptions.body) &&
Objects.equals(this.html, sendEmailOptions.html) &&
Objects.equals(this.isHTML, sendEmailOptions.isHTML) &&
Objects.equals(this.charset, sendEmailOptions.charset) &&
Objects.equals(this.attachments, sendEmailOptions.attachments) &&
Objects.equals(this.templateVariables, sendEmailOptions.templateVariables) &&
Objects.equals(this.template, sendEmailOptions.template) &&
Objects.equals(this.sendStrategy, sendEmailOptions.sendStrategy) &&
Objects.equals(this.useInboxName, sendEmailOptions.useInboxName) &&
Objects.equals(this.addTrackingPixel, sendEmailOptions.addTrackingPixel) &&
Objects.equals(this.filterBouncedRecipients, sendEmailOptions.filterBouncedRecipients) &&
Objects.equals(this.validateEmailAddresses, sendEmailOptions.validateEmailAddresses);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(toContacts, toGroup, to, from, cc, bcc, subject, replyTo, body, html, isHTML, charset, attachments, templateVariables, template, sendStrategy, useInboxName, addTrackingPixel, filterBouncedRecipients, validateEmailAddresses);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SendEmailOptions {\n");
sb.append(" toContacts: ").append(toIndentedString(toContacts)).append("\n");
sb.append(" toGroup: ").append(toIndentedString(toGroup)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n");
sb.append(" template: ").append(toIndentedString(template)).append("\n");
sb.append(" sendStrategy: ").append(toIndentedString(sendStrategy)).append("\n");
sb.append(" useInboxName: ").append(toIndentedString(useInboxName)).append("\n");
sb.append(" addTrackingPixel: ").append(toIndentedString(addTrackingPixel)).append("\n");
sb.append(" filterBouncedRecipients: ").append(toIndentedString(filterBouncedRecipients)).append("\n");
sb.append(" validateEmailAddresses: ").append(toIndentedString(validateEmailAddresses)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("toContacts");
openapiFields.add("toGroup");
openapiFields.add("to");
openapiFields.add("from");
openapiFields.add("cc");
openapiFields.add("bcc");
openapiFields.add("subject");
openapiFields.add("replyTo");
openapiFields.add("body");
openapiFields.add("html");
openapiFields.add("isHTML");
openapiFields.add("charset");
openapiFields.add("attachments");
openapiFields.add("templateVariables");
openapiFields.add("template");
openapiFields.add("sendStrategy");
openapiFields.add("useInboxName");
openapiFields.add("addTrackingPixel");
openapiFields.add("filterBouncedRecipients");
openapiFields.add("validateEmailAddresses");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to SendEmailOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!SendEmailOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in SendEmailOptions is not found in the empty JSON string", SendEmailOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!SendEmailOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SendEmailOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// ensure the optional json data is an array if present
if (jsonObj.get("toContacts") != null && !jsonObj.get("toContacts").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `toContacts` to be an array in the JSON string but got `%s`", jsonObj.get("toContacts").toString()));
}
if ((jsonObj.get("toGroup") != null && !jsonObj.get("toGroup").isJsonNull()) && !jsonObj.get("toGroup").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `toGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toGroup").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
if ((jsonObj.get("template") != null && !jsonObj.get("template").isJsonNull()) && !jsonObj.get("template").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("template").toString()));
}
if ((jsonObj.get("sendStrategy") != null && !jsonObj.get("sendStrategy").isJsonNull()) && !jsonObj.get("sendStrategy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sendStrategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sendStrategy").toString()));
}
if ((jsonObj.get("validateEmailAddresses") != null && !jsonObj.get("validateEmailAddresses").isJsonNull()) && !jsonObj.get("validateEmailAddresses").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `validateEmailAddresses` to be a primitive type in the JSON string but got `%s`", jsonObj.get("validateEmailAddresses").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!SendEmailOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'SendEmailOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<SendEmailOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(SendEmailOptions.class));
return (TypeAdapter<T>) new TypeAdapter<SendEmailOptions>() {
@Override
public void write(JsonWriter out, SendEmailOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public SendEmailOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of SendEmailOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of SendEmailOptions
* @throws IOException if the JSON string is invalid with respect to SendEmailOptions
*/
public static SendEmailOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, SendEmailOptions.class);
}
/**
* Convert an instance of SendEmailOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ScheduledJobDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ScheduledJobDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_JOB_ID = "jobId";
@SerializedName(SERIALIZED_NAME_JOB_ID)
private String jobId;
public static final String SERIALIZED_NAME_GROUP_ID = "groupId";
@SerializedName(SERIALIZED_NAME_GROUP_ID)
private String groupId;
public static final String SERIALIZED_NAME_TRIGGER_ID = "triggerId";
@SerializedName(SERIALIZED_NAME_TRIGGER_ID)
private String triggerId;
/**
* Gets or Sets status
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
SUBMITTED("SUBMITTED"),
COMPLETED("COMPLETED"),
FAILED("FAILED"),
CANCELLED("CANCELLED");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<StatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private StatusEnum status;
public static final String SERIALIZED_NAME_SEND_AT_TIMESTAMP = "sendAtTimestamp";
@SerializedName(SERIALIZED_NAME_SEND_AT_TIMESTAMP)
private OffsetDateTime sendAtTimestamp;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public ScheduledJobDto() {
}
public ScheduledJobDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ScheduledJobDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public ScheduledJobDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public ScheduledJobDto jobId(String jobId) {
this.jobId = jobId;
return this;
}
/**
* Get jobId
* @return jobId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getJobId() {
return jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
public ScheduledJobDto groupId(String groupId) {
this.groupId = groupId;
return this;
}
/**
* Get groupId
* @return groupId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public ScheduledJobDto triggerId(String triggerId) {
this.triggerId = triggerId;
return this;
}
/**
* Get triggerId
* @return triggerId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getTriggerId() {
return triggerId;
}
public void setTriggerId(String triggerId) {
this.triggerId = triggerId;
}
public ScheduledJobDto status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public ScheduledJobDto sendAtTimestamp(OffsetDateTime sendAtTimestamp) {
this.sendAtTimestamp = sendAtTimestamp;
return this;
}
/**
* Get sendAtTimestamp
* @return sendAtTimestamp
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getSendAtTimestamp() {
return sendAtTimestamp;
}
public void setSendAtTimestamp(OffsetDateTime sendAtTimestamp) {
this.sendAtTimestamp = sendAtTimestamp;
}
public ScheduledJobDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ScheduledJobDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScheduledJobDto scheduledJobDto = (ScheduledJobDto) o;
return Objects.equals(this.id, scheduledJobDto.id) &&
Objects.equals(this.userId, scheduledJobDto.userId) &&
Objects.equals(this.inboxId, scheduledJobDto.inboxId) &&
Objects.equals(this.jobId, scheduledJobDto.jobId) &&
Objects.equals(this.groupId, scheduledJobDto.groupId) &&
Objects.equals(this.triggerId, scheduledJobDto.triggerId) &&
Objects.equals(this.status, scheduledJobDto.status) &&
Objects.equals(this.sendAtTimestamp, scheduledJobDto.sendAtTimestamp) &&
Objects.equals(this.createdAt, scheduledJobDto.createdAt) &&
Objects.equals(this.updatedAt, scheduledJobDto.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, inboxId, jobId, groupId, triggerId, status, sendAtTimestamp, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ScheduledJobDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
sb.append(" triggerId: ").append(toIndentedString(triggerId)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" sendAtTimestamp: ").append(toIndentedString(sendAtTimestamp)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("inboxId");
openapiFields.add("jobId");
openapiFields.add("groupId");
openapiFields.add("triggerId");
openapiFields.add("status");
openapiFields.add("sendAtTimestamp");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("jobId");
openapiRequiredFields.add("groupId");
openapiRequiredFields.add("triggerId");
openapiRequiredFields.add("status");
openapiRequiredFields.add("sendAtTimestamp");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ScheduledJobDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ScheduledJobDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ScheduledJobDto is not found in the empty JSON string", ScheduledJobDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ScheduledJobDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScheduledJobDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ScheduledJobDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("jobId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `jobId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jobId").toString()));
}
if (!jsonObj.get("groupId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `groupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupId").toString()));
}
if (!jsonObj.get("triggerId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `triggerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("triggerId").toString()));
}
if (!jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ScheduledJobDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ScheduledJobDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ScheduledJobDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ScheduledJobDto.class));
return (TypeAdapter<T>) new TypeAdapter<ScheduledJobDto>() {
@Override
public void write(JsonWriter out, ScheduledJobDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ScheduledJobDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ScheduledJobDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of ScheduledJobDto
* @throws IOException if the JSON string is invalid with respect to ScheduledJobDto
*/
public static ScheduledJobDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ScheduledJobDto.class);
}
/**
* Convert an instance of ScheduledJobDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ScheduledJob
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ScheduledJob {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_JOB_ID = "jobId";
@SerializedName(SERIALIZED_NAME_JOB_ID)
private String jobId;
public static final String SERIALIZED_NAME_GROUP_ID = "groupId";
@SerializedName(SERIALIZED_NAME_GROUP_ID)
private String groupId;
public static final String SERIALIZED_NAME_TRIGGER_ID = "triggerId";
@SerializedName(SERIALIZED_NAME_TRIGGER_ID)
private String triggerId;
/**
* Gets or Sets status
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
SUBMITTED("SUBMITTED"),
COMPLETED("COMPLETED"),
FAILED("FAILED"),
CANCELLED("CANCELLED");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<StatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private StatusEnum status;
public static final String SERIALIZED_NAME_SEND_AT_TIMESTAMP = "sendAtTimestamp";
@SerializedName(SERIALIZED_NAME_SEND_AT_TIMESTAMP)
private OffsetDateTime sendAtTimestamp;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public ScheduledJob() {
}
public ScheduledJob id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ScheduledJob userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public ScheduledJob inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public ScheduledJob jobId(String jobId) {
this.jobId = jobId;
return this;
}
/**
* Get jobId
* @return jobId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getJobId() {
return jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
public ScheduledJob groupId(String groupId) {
this.groupId = groupId;
return this;
}
/**
* Get groupId
* @return groupId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public ScheduledJob triggerId(String triggerId) {
this.triggerId = triggerId;
return this;
}
/**
* Get triggerId
* @return triggerId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getTriggerId() {
return triggerId;
}
public void setTriggerId(String triggerId) {
this.triggerId = triggerId;
}
public ScheduledJob status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public ScheduledJob sendAtTimestamp(OffsetDateTime sendAtTimestamp) {
this.sendAtTimestamp = sendAtTimestamp;
return this;
}
/**
* Get sendAtTimestamp
* @return sendAtTimestamp
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getSendAtTimestamp() {
return sendAtTimestamp;
}
public void setSendAtTimestamp(OffsetDateTime sendAtTimestamp) {
this.sendAtTimestamp = sendAtTimestamp;
}
public ScheduledJob createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ScheduledJob updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScheduledJob scheduledJob = (ScheduledJob) o;
return Objects.equals(this.id, scheduledJob.id) &&
Objects.equals(this.userId, scheduledJob.userId) &&
Objects.equals(this.inboxId, scheduledJob.inboxId) &&
Objects.equals(this.jobId, scheduledJob.jobId) &&
Objects.equals(this.groupId, scheduledJob.groupId) &&
Objects.equals(this.triggerId, scheduledJob.triggerId) &&
Objects.equals(this.status, scheduledJob.status) &&
Objects.equals(this.sendAtTimestamp, scheduledJob.sendAtTimestamp) &&
Objects.equals(this.createdAt, scheduledJob.createdAt) &&
Objects.equals(this.updatedAt, scheduledJob.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, inboxId, jobId, groupId, triggerId, status, sendAtTimestamp, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ScheduledJob {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
sb.append(" triggerId: ").append(toIndentedString(triggerId)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" sendAtTimestamp: ").append(toIndentedString(sendAtTimestamp)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("inboxId");
openapiFields.add("jobId");
openapiFields.add("groupId");
openapiFields.add("triggerId");
openapiFields.add("status");
openapiFields.add("sendAtTimestamp");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("jobId");
openapiRequiredFields.add("groupId");
openapiRequiredFields.add("triggerId");
openapiRequiredFields.add("status");
openapiRequiredFields.add("sendAtTimestamp");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ScheduledJob
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ScheduledJob.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ScheduledJob is not found in the empty JSON string", ScheduledJob.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ScheduledJob.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScheduledJob` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ScheduledJob.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("jobId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `jobId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jobId").toString()));
}
if (!jsonObj.get("groupId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `groupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupId").toString()));
}
if (!jsonObj.get("triggerId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `triggerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("triggerId").toString()));
}
if (!jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ScheduledJob.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ScheduledJob' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ScheduledJob> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ScheduledJob.class));
return (TypeAdapter<T>) new TypeAdapter<ScheduledJob>() {
@Override
public void write(JsonWriter out, ScheduledJob value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ScheduledJob read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ScheduledJob given an JSON string
*
* @param jsonString JSON string
* @return An instance of ScheduledJob
* @throws IOException if the JSON string is invalid with respect to ScheduledJob
*/
public static ScheduledJob fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ScheduledJob.class);
}
/**
* Convert an instance of ScheduledJob to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for replying to email with API
*/
@ApiModel(description = "Options for replying to email with API")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ReplyToEmailOptions {
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public static final String SERIALIZED_NAME_TEMPLATE = "template";
@SerializedName(SERIALIZED_NAME_TEMPLATE)
private UUID template;
/**
* How an email should be sent based on its recipients
*/
@JsonAdapter(SendStrategyEnum.Adapter.class)
public enum SendStrategyEnum {
SINGLE_MESSAGE("SINGLE_MESSAGE");
private String value;
SendStrategyEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SendStrategyEnum fromValue(String value) {
for (SendStrategyEnum b : SendStrategyEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<SendStrategyEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SendStrategyEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SendStrategyEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SendStrategyEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SEND_STRATEGY = "sendStrategy";
@SerializedName(SERIALIZED_NAME_SEND_STRATEGY)
private SendStrategyEnum sendStrategy;
public static final String SERIALIZED_NAME_USE_INBOX_NAME = "useInboxName";
@SerializedName(SERIALIZED_NAME_USE_INBOX_NAME)
private Boolean useInboxName;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private Boolean html;
public ReplyToEmailOptions() {
}
public ReplyToEmailOptions body(String body) {
this.body = body;
return this;
}
/**
* Body of the reply email you want to send
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Body of the reply email you want to send")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public ReplyToEmailOptions isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Is the reply HTML
* @return isHTML
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the reply HTML")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public ReplyToEmailOptions from(String from) {
this.from = from;
return this;
}
/**
* The from header that should be used. Optional
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The from header that should be used. Optional")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public ReplyToEmailOptions replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* The replyTo header that should be used. Optional
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The replyTo header that should be used. Optional")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public ReplyToEmailOptions charset(String charset) {
this.charset = charset;
return this;
}
/**
* The charset that your message should be sent with. Optional. Default is UTF-8
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The charset that your message should be sent with. Optional. Default is UTF-8")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public ReplyToEmailOptions attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public ReplyToEmailOptions addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* List of uploaded attachments to send with the reply. Optional.
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of uploaded attachments to send with the reply. Optional.")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public ReplyToEmailOptions templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public ReplyToEmailOptions putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Template variables if using a template
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template variables if using a template")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
public ReplyToEmailOptions template(UUID template) {
this.template = template;
return this;
}
/**
* Template ID to use instead of body. Will use template variable map to fill defined variable slots.
* @return template
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template ID to use instead of body. Will use template variable map to fill defined variable slots.")
public UUID getTemplate() {
return template;
}
public void setTemplate(UUID template) {
this.template = template;
}
public ReplyToEmailOptions sendStrategy(SendStrategyEnum sendStrategy) {
this.sendStrategy = sendStrategy;
return this;
}
/**
* How an email should be sent based on its recipients
* @return sendStrategy
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "How an email should be sent based on its recipients")
public SendStrategyEnum getSendStrategy() {
return sendStrategy;
}
public void setSendStrategy(SendStrategyEnum sendStrategy) {
this.sendStrategy = sendStrategy;
}
public ReplyToEmailOptions useInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
return this;
}
/**
* Optionally use inbox name as display name for sender email address
* @return useInboxName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optionally use inbox name as display name for sender email address")
public Boolean getUseInboxName() {
return useInboxName;
}
public void setUseInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
}
public ReplyToEmailOptions html(Boolean html) {
this.html = html;
return this;
}
/**
* Get html
* @return html
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getHtml() {
return html;
}
public void setHtml(Boolean html) {
this.html = html;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReplyToEmailOptions replyToEmailOptions = (ReplyToEmailOptions) o;
return Objects.equals(this.body, replyToEmailOptions.body) &&
Objects.equals(this.isHTML, replyToEmailOptions.isHTML) &&
Objects.equals(this.from, replyToEmailOptions.from) &&
Objects.equals(this.replyTo, replyToEmailOptions.replyTo) &&
Objects.equals(this.charset, replyToEmailOptions.charset) &&
Objects.equals(this.attachments, replyToEmailOptions.attachments) &&
Objects.equals(this.templateVariables, replyToEmailOptions.templateVariables) &&
Objects.equals(this.template, replyToEmailOptions.template) &&
Objects.equals(this.sendStrategy, replyToEmailOptions.sendStrategy) &&
Objects.equals(this.useInboxName, replyToEmailOptions.useInboxName) &&
Objects.equals(this.html, replyToEmailOptions.html);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(body, isHTML, from, replyTo, charset, attachments, templateVariables, template, sendStrategy, useInboxName, html);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReplyToEmailOptions {\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n");
sb.append(" template: ").append(toIndentedString(template)).append("\n");
sb.append(" sendStrategy: ").append(toIndentedString(sendStrategy)).append("\n");
sb.append(" useInboxName: ").append(toIndentedString(useInboxName)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("body");
openapiFields.add("isHTML");
openapiFields.add("from");
openapiFields.add("replyTo");
openapiFields.add("charset");
openapiFields.add("attachments");
openapiFields.add("templateVariables");
openapiFields.add("template");
openapiFields.add("sendStrategy");
openapiFields.add("useInboxName");
openapiFields.add("html");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("body");
openapiRequiredFields.add("isHTML");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ReplyToEmailOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ReplyToEmailOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ReplyToEmailOptions is not found in the empty JSON string", ReplyToEmailOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ReplyToEmailOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReplyToEmailOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ReplyToEmailOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
if ((jsonObj.get("template") != null && !jsonObj.get("template").isJsonNull()) && !jsonObj.get("template").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("template").toString()));
}
if ((jsonObj.get("sendStrategy") != null && !jsonObj.get("sendStrategy").isJsonNull()) && !jsonObj.get("sendStrategy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sendStrategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sendStrategy").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ReplyToEmailOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ReplyToEmailOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ReplyToEmailOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ReplyToEmailOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ReplyToEmailOptions>() {
@Override
public void write(JsonWriter out, ReplyToEmailOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ReplyToEmailOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ReplyToEmailOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ReplyToEmailOptions
* @throws IOException if the JSON string is invalid with respect to ReplyToEmailOptions
*/
public static ReplyToEmailOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ReplyToEmailOptions.class);
}
/**
* Convert an instance of ReplyToEmailOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for replying to an alias email using the alias inbox
*/
@ApiModel(description = "Options for replying to an alias email using the alias inbox")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ReplyToAliasEmailOptions {
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public static final String SERIALIZED_NAME_TEMPLATE = "template";
@SerializedName(SERIALIZED_NAME_TEMPLATE)
private UUID template;
/**
* How an email should be sent based on its recipients
*/
@JsonAdapter(SendStrategyEnum.Adapter.class)
public enum SendStrategyEnum {
SINGLE_MESSAGE("SINGLE_MESSAGE");
private String value;
SendStrategyEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SendStrategyEnum fromValue(String value) {
for (SendStrategyEnum b : SendStrategyEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<SendStrategyEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SendStrategyEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SendStrategyEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SendStrategyEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SEND_STRATEGY = "sendStrategy";
@SerializedName(SERIALIZED_NAME_SEND_STRATEGY)
private SendStrategyEnum sendStrategy;
public static final String SERIALIZED_NAME_USE_INBOX_NAME = "useInboxName";
@SerializedName(SERIALIZED_NAME_USE_INBOX_NAME)
private Boolean useInboxName;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private Boolean html;
public ReplyToAliasEmailOptions() {
}
public ReplyToAliasEmailOptions body(String body) {
this.body = body;
return this;
}
/**
* Body of the reply email you want to send
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Body of the reply email you want to send")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public ReplyToAliasEmailOptions isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Is the reply HTML
* @return isHTML
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the reply HTML")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public ReplyToAliasEmailOptions charset(String charset) {
this.charset = charset;
return this;
}
/**
* The charset that your message should be sent with. Optional. Default is UTF-8
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The charset that your message should be sent with. Optional. Default is UTF-8")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public ReplyToAliasEmailOptions attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public ReplyToAliasEmailOptions addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* List of uploaded attachments to send with the reply. Optional.
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of uploaded attachments to send with the reply. Optional.")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public ReplyToAliasEmailOptions templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public ReplyToAliasEmailOptions putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Template variables if using a template
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template variables if using a template")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
public ReplyToAliasEmailOptions template(UUID template) {
this.template = template;
return this;
}
/**
* Template ID to use instead of body. Will use template variable map to fill defined variable slots.
* @return template
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template ID to use instead of body. Will use template variable map to fill defined variable slots.")
public UUID getTemplate() {
return template;
}
public void setTemplate(UUID template) {
this.template = template;
}
public ReplyToAliasEmailOptions sendStrategy(SendStrategyEnum sendStrategy) {
this.sendStrategy = sendStrategy;
return this;
}
/**
* How an email should be sent based on its recipients
* @return sendStrategy
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "How an email should be sent based on its recipients")
public SendStrategyEnum getSendStrategy() {
return sendStrategy;
}
public void setSendStrategy(SendStrategyEnum sendStrategy) {
this.sendStrategy = sendStrategy;
}
public ReplyToAliasEmailOptions useInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
return this;
}
/**
* Optionally use inbox name as display name for sender email address
* @return useInboxName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optionally use inbox name as display name for sender email address")
public Boolean getUseInboxName() {
return useInboxName;
}
public void setUseInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
}
public ReplyToAliasEmailOptions html(Boolean html) {
this.html = html;
return this;
}
/**
* Get html
* @return html
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getHtml() {
return html;
}
public void setHtml(Boolean html) {
this.html = html;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReplyToAliasEmailOptions replyToAliasEmailOptions = (ReplyToAliasEmailOptions) o;
return Objects.equals(this.body, replyToAliasEmailOptions.body) &&
Objects.equals(this.isHTML, replyToAliasEmailOptions.isHTML) &&
Objects.equals(this.charset, replyToAliasEmailOptions.charset) &&
Objects.equals(this.attachments, replyToAliasEmailOptions.attachments) &&
Objects.equals(this.templateVariables, replyToAliasEmailOptions.templateVariables) &&
Objects.equals(this.template, replyToAliasEmailOptions.template) &&
Objects.equals(this.sendStrategy, replyToAliasEmailOptions.sendStrategy) &&
Objects.equals(this.useInboxName, replyToAliasEmailOptions.useInboxName) &&
Objects.equals(this.html, replyToAliasEmailOptions.html);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(body, isHTML, charset, attachments, templateVariables, template, sendStrategy, useInboxName, html);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReplyToAliasEmailOptions {\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n");
sb.append(" template: ").append(toIndentedString(template)).append("\n");
sb.append(" sendStrategy: ").append(toIndentedString(sendStrategy)).append("\n");
sb.append(" useInboxName: ").append(toIndentedString(useInboxName)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("body");
openapiFields.add("isHTML");
openapiFields.add("charset");
openapiFields.add("attachments");
openapiFields.add("templateVariables");
openapiFields.add("template");
openapiFields.add("sendStrategy");
openapiFields.add("useInboxName");
openapiFields.add("html");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("body");
openapiRequiredFields.add("isHTML");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ReplyToAliasEmailOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ReplyToAliasEmailOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ReplyToAliasEmailOptions is not found in the empty JSON string", ReplyToAliasEmailOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ReplyToAliasEmailOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReplyToAliasEmailOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ReplyToAliasEmailOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
if ((jsonObj.get("template") != null && !jsonObj.get("template").isJsonNull()) && !jsonObj.get("template").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("template").toString()));
}
if ((jsonObj.get("sendStrategy") != null && !jsonObj.get("sendStrategy").isJsonNull()) && !jsonObj.get("sendStrategy").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sendStrategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sendStrategy").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ReplyToAliasEmailOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ReplyToAliasEmailOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ReplyToAliasEmailOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ReplyToAliasEmailOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ReplyToAliasEmailOptions>() {
@Override
public void write(JsonWriter out, ReplyToAliasEmailOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ReplyToAliasEmailOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ReplyToAliasEmailOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ReplyToAliasEmailOptions
* @throws IOException if the JSON string is invalid with respect to ReplyToAliasEmailOptions
*/
public static ReplyToAliasEmailOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ReplyToAliasEmailOptions.class);
}
/**
* Convert an instance of ReplyToAliasEmailOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email recipient
*/
@ApiModel(description = "Email recipient")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Recipient {
public static final String SERIALIZED_NAME_RAW_VALUE = "rawValue";
@SerializedName(SERIALIZED_NAME_RAW_VALUE)
private String rawValue;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public Recipient() {
}
public Recipient rawValue(String rawValue) {
this.rawValue = rawValue;
return this;
}
/**
* Get rawValue
* @return rawValue
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRawValue() {
return rawValue;
}
public void setRawValue(String rawValue) {
this.rawValue = rawValue;
}
public Recipient emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public Recipient name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Recipient recipient = (Recipient) o;
return Objects.equals(this.rawValue, recipient.rawValue) &&
Objects.equals(this.emailAddress, recipient.emailAddress) &&
Objects.equals(this.name, recipient.name);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(rawValue, emailAddress, name);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Recipient {\n");
sb.append(" rawValue: ").append(toIndentedString(rawValue)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("rawValue");
openapiFields.add("emailAddress");
openapiFields.add("name");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("rawValue");
openapiRequiredFields.add("emailAddress");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to Recipient
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!Recipient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Recipient is not found in the empty JSON string", Recipient.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!Recipient.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Recipient` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Recipient.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("rawValue").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `rawValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawValue").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!Recipient.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'Recipient' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Recipient> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(Recipient.class));
return (TypeAdapter<T>) new TypeAdapter<Recipient>() {
@Override
public void write(JsonWriter out, Recipient value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public Recipient read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of Recipient given an JSON string
*
* @param jsonString JSON string
* @return An instance of Recipient
* @throws IOException if the JSON string is invalid with respect to Recipient
*/
public static Recipient fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Recipient.class);
}
/**
* Convert an instance of Recipient to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Content in raw format
*/
@ApiModel(description = "Content in raw format")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class RawEmailJson {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private String content;
public RawEmailJson() {
}
public RawEmailJson content(String content) {
this.content = content;
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RawEmailJson rawEmailJson = (RawEmailJson) o;
return Objects.equals(this.content, rawEmailJson.content);
}
@Override
public int hashCode() {
return Objects.hash(content);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RawEmailJson {\n");
sb.append(" content: ").append(toIndentedString(content)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("content");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to RawEmailJson
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!RawEmailJson.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in RawEmailJson is not found in the empty JSON string", RawEmailJson.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!RawEmailJson.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RawEmailJson` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : RawEmailJson.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("content").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!RawEmailJson.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'RawEmailJson' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<RawEmailJson> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(RawEmailJson.class));
return (TypeAdapter<T>) new TypeAdapter<RawEmailJson>() {
@Override
public void write(JsonWriter out, RawEmailJson value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public RawEmailJson read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of RawEmailJson given an JSON string
*
* @param jsonString JSON string
* @return An instance of RawEmailJson
* @throws IOException if the JSON string is invalid with respect to RawEmailJson
*/
public static RawEmailJson fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, RawEmailJson.class);
}
/**
* Convert an instance of RawEmailJson to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* PhonePlanDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PhonePlanDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
/**
* Gets or Sets phoneCountry
*/
@JsonAdapter(PhoneCountryEnum.Adapter.class)
public enum PhoneCountryEnum {
US("US"),
GB("GB"),
AU("AU");
private String value;
PhoneCountryEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PhoneCountryEnum fromValue(String value) {
for (PhoneCountryEnum b : PhoneCountryEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<PhoneCountryEnum> {
@Override
public void write(final JsonWriter jsonWriter, final PhoneCountryEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PhoneCountryEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PhoneCountryEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_PHONE_COUNTRY = "phoneCountry";
@SerializedName(SERIALIZED_NAME_PHONE_COUNTRY)
private PhoneCountryEnum phoneCountry;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public PhonePlanDto() {
}
public PhonePlanDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public PhonePlanDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public PhonePlanDto phoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
return this;
}
/**
* Get phoneCountry
* @return phoneCountry
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public PhoneCountryEnum getPhoneCountry() {
return phoneCountry;
}
public void setPhoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
}
public PhonePlanDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PhonePlanDto phonePlanDto = (PhonePlanDto) o;
return Objects.equals(this.id, phonePlanDto.id) &&
Objects.equals(this.userId, phonePlanDto.userId) &&
Objects.equals(this.phoneCountry, phonePlanDto.phoneCountry) &&
Objects.equals(this.createdAt, phonePlanDto.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, phoneCountry, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PhonePlanDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" phoneCountry: ").append(toIndentedString(phoneCountry)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("phoneCountry");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("phoneCountry");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PhonePlanDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PhonePlanDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PhonePlanDto is not found in the empty JSON string", PhonePlanDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PhonePlanDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhonePlanDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : PhonePlanDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("phoneCountry").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountry").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PhonePlanDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PhonePlanDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PhonePlanDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PhonePlanDto.class));
return (TypeAdapter<T>) new TypeAdapter<PhonePlanDto>() {
@Override
public void write(JsonWriter out, PhonePlanDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PhonePlanDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PhonePlanDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of PhonePlanDto
* @throws IOException if the JSON string is invalid with respect to PhonePlanDto
*/
public static PhonePlanDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PhonePlanDto.class);
}
/**
* Convert an instance of PhonePlanDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Phone number projection
*/
@ApiModel(description = "Phone number projection")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PhoneNumberProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
private String phoneNumber;
/**
* Gets or Sets phoneCountry
*/
@JsonAdapter(PhoneCountryEnum.Adapter.class)
public enum PhoneCountryEnum {
US("US"),
GB("GB"),
AU("AU");
private String value;
PhoneCountryEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PhoneCountryEnum fromValue(String value) {
for (PhoneCountryEnum b : PhoneCountryEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<PhoneCountryEnum> {
@Override
public void write(final JsonWriter jsonWriter, final PhoneCountryEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PhoneCountryEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PhoneCountryEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_PHONE_COUNTRY = "phoneCountry";
@SerializedName(SERIALIZED_NAME_PHONE_COUNTRY)
private PhoneCountryEnum phoneCountry;
public PhoneNumberProjection() {
}
public PhoneNumberProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public PhoneNumberProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public PhoneNumberProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public PhoneNumberProjection phoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* Get phoneNumber
* @return phoneNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public PhoneNumberProjection phoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
return this;
}
/**
* Get phoneCountry
* @return phoneCountry
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public PhoneCountryEnum getPhoneCountry() {
return phoneCountry;
}
public void setPhoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PhoneNumberProjection phoneNumberProjection = (PhoneNumberProjection) o;
return Objects.equals(this.id, phoneNumberProjection.id) &&
Objects.equals(this.userId, phoneNumberProjection.userId) &&
Objects.equals(this.createdAt, phoneNumberProjection.createdAt) &&
Objects.equals(this.phoneNumber, phoneNumberProjection.phoneNumber) &&
Objects.equals(this.phoneCountry, phoneNumberProjection.phoneCountry);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, createdAt, phoneNumber, phoneCountry);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PhoneNumberProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" phoneCountry: ").append(toIndentedString(phoneCountry)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("phoneNumber");
openapiFields.add("phoneCountry");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("phoneNumber");
openapiRequiredFields.add("phoneCountry");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PhoneNumberProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PhoneNumberProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumberProjection is not found in the empty JSON string", PhoneNumberProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PhoneNumberProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumberProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : PhoneNumberProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("phoneNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString()));
}
if (!jsonObj.get("phoneCountry").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountry").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PhoneNumberProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PhoneNumberProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PhoneNumberProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PhoneNumberProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PhoneNumberProjection>() {
@Override
public void write(JsonWriter out, PhoneNumberProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PhoneNumberProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PhoneNumberProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PhoneNumberProjection
* @throws IOException if the JSON string is invalid with respect to PhoneNumberProjection
*/
public static PhoneNumberProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PhoneNumberProjection.class);
}
/**
* Convert an instance of PhoneNumberProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* PhoneNumberDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PhoneNumberDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_COMPLIANCE_ADDRESS = "complianceAddress";
@SerializedName(SERIALIZED_NAME_COMPLIANCE_ADDRESS)
private UUID complianceAddress;
public static final String SERIALIZED_NAME_EMERGENCY_ADDRESS = "emergencyAddress";
@SerializedName(SERIALIZED_NAME_EMERGENCY_ADDRESS)
private UUID emergencyAddress;
public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber";
@SerializedName(SERIALIZED_NAME_PHONE_NUMBER)
private String phoneNumber;
/**
* Gets or Sets phoneCountry
*/
@JsonAdapter(PhoneCountryEnum.Adapter.class)
public enum PhoneCountryEnum {
US("US"),
GB("GB"),
AU("AU");
private String value;
PhoneCountryEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PhoneCountryEnum fromValue(String value) {
for (PhoneCountryEnum b : PhoneCountryEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<PhoneCountryEnum> {
@Override
public void write(final JsonWriter jsonWriter, final PhoneCountryEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PhoneCountryEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PhoneCountryEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_PHONE_COUNTRY = "phoneCountry";
@SerializedName(SERIALIZED_NAME_PHONE_COUNTRY)
private PhoneCountryEnum phoneCountry;
public static final String SERIALIZED_NAME_PHONE_PLAN = "phonePlan";
@SerializedName(SERIALIZED_NAME_PHONE_PLAN)
private UUID phonePlan;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public PhoneNumberDto() {
}
public PhoneNumberDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public PhoneNumberDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public PhoneNumberDto complianceAddress(UUID complianceAddress) {
this.complianceAddress = complianceAddress;
return this;
}
/**
* Get complianceAddress
* @return complianceAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getComplianceAddress() {
return complianceAddress;
}
public void setComplianceAddress(UUID complianceAddress) {
this.complianceAddress = complianceAddress;
}
public PhoneNumberDto emergencyAddress(UUID emergencyAddress) {
this.emergencyAddress = emergencyAddress;
return this;
}
/**
* Get emergencyAddress
* @return emergencyAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getEmergencyAddress() {
return emergencyAddress;
}
public void setEmergencyAddress(UUID emergencyAddress) {
this.emergencyAddress = emergencyAddress;
}
public PhoneNumberDto phoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* Get phoneNumber
* @return phoneNumber
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public PhoneNumberDto phoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
return this;
}
/**
* Get phoneCountry
* @return phoneCountry
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public PhoneCountryEnum getPhoneCountry() {
return phoneCountry;
}
public void setPhoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
}
public PhoneNumberDto phonePlan(UUID phonePlan) {
this.phonePlan = phonePlan;
return this;
}
/**
* Get phonePlan
* @return phonePlan
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getPhonePlan() {
return phonePlan;
}
public void setPhonePlan(UUID phonePlan) {
this.phonePlan = phonePlan;
}
public PhoneNumberDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public PhoneNumberDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PhoneNumberDto phoneNumberDto = (PhoneNumberDto) o;
return Objects.equals(this.id, phoneNumberDto.id) &&
Objects.equals(this.userId, phoneNumberDto.userId) &&
Objects.equals(this.complianceAddress, phoneNumberDto.complianceAddress) &&
Objects.equals(this.emergencyAddress, phoneNumberDto.emergencyAddress) &&
Objects.equals(this.phoneNumber, phoneNumberDto.phoneNumber) &&
Objects.equals(this.phoneCountry, phoneNumberDto.phoneCountry) &&
Objects.equals(this.phonePlan, phoneNumberDto.phonePlan) &&
Objects.equals(this.createdAt, phoneNumberDto.createdAt) &&
Objects.equals(this.updatedAt, phoneNumberDto.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, complianceAddress, emergencyAddress, phoneNumber, phoneCountry, phonePlan, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PhoneNumberDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" complianceAddress: ").append(toIndentedString(complianceAddress)).append("\n");
sb.append(" emergencyAddress: ").append(toIndentedString(emergencyAddress)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append(" phoneCountry: ").append(toIndentedString(phoneCountry)).append("\n");
sb.append(" phonePlan: ").append(toIndentedString(phonePlan)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("complianceAddress");
openapiFields.add("emergencyAddress");
openapiFields.add("phoneNumber");
openapiFields.add("phoneCountry");
openapiFields.add("phonePlan");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("phoneNumber");
openapiRequiredFields.add("phoneCountry");
openapiRequiredFields.add("phonePlan");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PhoneNumberDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PhoneNumberDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumberDto is not found in the empty JSON string", PhoneNumberDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PhoneNumberDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumberDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : PhoneNumberDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("complianceAddress") != null && !jsonObj.get("complianceAddress").isJsonNull()) && !jsonObj.get("complianceAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `complianceAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("complianceAddress").toString()));
}
if ((jsonObj.get("emergencyAddress") != null && !jsonObj.get("emergencyAddress").isJsonNull()) && !jsonObj.get("emergencyAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emergencyAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emergencyAddress").toString()));
}
if (!jsonObj.get("phoneNumber").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString()));
}
if (!jsonObj.get("phoneCountry").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountry").toString()));
}
if (!jsonObj.get("phonePlan").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phonePlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phonePlan").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PhoneNumberDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PhoneNumberDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PhoneNumberDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PhoneNumberDto.class));
return (TypeAdapter<T>) new TypeAdapter<PhoneNumberDto>() {
@Override
public void write(JsonWriter out, PhoneNumberDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PhoneNumberDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PhoneNumberDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of PhoneNumberDto
* @throws IOException if the JSON string is invalid with respect to PhoneNumberDto
*/
public static PhoneNumberDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PhoneNumberDto.class);
}
/**
* Convert an instance of PhoneNumberDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* PageableObject
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageableObject {
public static final String SERIALIZED_NAME_OFFSET = "offset";
@SerializedName(SERIALIZED_NAME_OFFSET)
private Long offset;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_PAGE_NUMBER = "pageNumber";
@SerializedName(SERIALIZED_NAME_PAGE_NUMBER)
private Integer pageNumber;
public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize";
@SerializedName(SERIALIZED_NAME_PAGE_SIZE)
private Integer pageSize;
public static final String SERIALIZED_NAME_PAGED = "paged";
@SerializedName(SERIALIZED_NAME_PAGED)
private Boolean paged;
public static final String SERIALIZED_NAME_UNPAGED = "unpaged";
@SerializedName(SERIALIZED_NAME_UNPAGED)
private Boolean unpaged;
public PageableObject() {
}
public PageableObject offset(Long offset) {
this.offset = offset;
return this;
}
/**
* Get offset
* @return offset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getOffset() {
return offset;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public PageableObject sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageableObject pageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
return this;
}
/**
* Get pageNumber
* @return pageNumber
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getPageNumber() {
return pageNumber;
}
public void setPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
}
public PageableObject pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Get pageSize
* @return pageSize
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public PageableObject paged(Boolean paged) {
this.paged = paged;
return this;
}
/**
* Get paged
* @return paged
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getPaged() {
return paged;
}
public void setPaged(Boolean paged) {
this.paged = paged;
}
public PageableObject unpaged(Boolean unpaged) {
this.unpaged = unpaged;
return this;
}
/**
* Get unpaged
* @return unpaged
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getUnpaged() {
return unpaged;
}
public void setUnpaged(Boolean unpaged) {
this.unpaged = unpaged;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageableObject pageableObject = (PageableObject) o;
return Objects.equals(this.offset, pageableObject.offset) &&
Objects.equals(this.sort, pageableObject.sort) &&
Objects.equals(this.pageNumber, pageableObject.pageNumber) &&
Objects.equals(this.pageSize, pageableObject.pageSize) &&
Objects.equals(this.paged, pageableObject.paged) &&
Objects.equals(this.unpaged, pageableObject.unpaged);
}
@Override
public int hashCode() {
return Objects.hash(offset, sort, pageNumber, pageSize, paged, unpaged);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageableObject {\n");
sb.append(" offset: ").append(toIndentedString(offset)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n");
sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n");
sb.append(" paged: ").append(toIndentedString(paged)).append("\n");
sb.append(" unpaged: ").append(toIndentedString(unpaged)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("offset");
openapiFields.add("sort");
openapiFields.add("pageNumber");
openapiFields.add("pageSize");
openapiFields.add("paged");
openapiFields.add("unpaged");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageableObject
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageableObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageableObject is not found in the empty JSON string", PageableObject.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageableObject.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageableObject` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageableObject.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageableObject' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageableObject> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageableObject.class));
return (TypeAdapter<T>) new TypeAdapter<PageableObject>() {
@Override
public void write(JsonWriter out, PageableObject value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageableObject read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageableObject given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageableObject
* @throws IOException if the JSON string is invalid with respect to PageableObject
*/
public static PageableObject fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageableObject.class);
}
/**
* Convert an instance of PageableObject to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.Sort;
import com.mailslurp.models.WebhookResultDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated webhook results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated webhook results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageWebhookResult {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<WebhookResultDto> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageWebhookResult() {
}
public PageWebhookResult content(List<WebhookResultDto> content) {
this.content = content;
return this;
}
public PageWebhookResult addContentItem(WebhookResultDto contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<WebhookResultDto> getContent() {
return content;
}
public void setContent(List<WebhookResultDto> content) {
this.content = content;
}
public PageWebhookResult pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageWebhookResult total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageWebhookResult totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageWebhookResult totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageWebhookResult last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageWebhookResult size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageWebhookResult number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageWebhookResult sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageWebhookResult numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageWebhookResult first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageWebhookResult empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageWebhookResult pageWebhookResult = (PageWebhookResult) o;
return Objects.equals(this.content, pageWebhookResult.content) &&
Objects.equals(this.pageable, pageWebhookResult.pageable) &&
Objects.equals(this.total, pageWebhookResult.total) &&
Objects.equals(this.totalElements, pageWebhookResult.totalElements) &&
Objects.equals(this.totalPages, pageWebhookResult.totalPages) &&
Objects.equals(this.last, pageWebhookResult.last) &&
Objects.equals(this.size, pageWebhookResult.size) &&
Objects.equals(this.number, pageWebhookResult.number) &&
Objects.equals(this.sort, pageWebhookResult.sort) &&
Objects.equals(this.numberOfElements, pageWebhookResult.numberOfElements) &&
Objects.equals(this.first, pageWebhookResult.first) &&
Objects.equals(this.empty, pageWebhookResult.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageWebhookResult {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageWebhookResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageWebhookResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageWebhookResult is not found in the empty JSON string", PageWebhookResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageWebhookResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageWebhookResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
WebhookResultDto.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageWebhookResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageWebhookResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageWebhookResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageWebhookResult.class));
return (TypeAdapter<T>) new TypeAdapter<PageWebhookResult>() {
@Override
public void write(JsonWriter out, PageWebhookResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageWebhookResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageWebhookResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageWebhookResult
* @throws IOException if the JSON string is invalid with respect to PageWebhookResult
*/
public static PageWebhookResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageWebhookResult.class);
}
/**
* Convert an instance of PageWebhookResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.Sort;
import com.mailslurp.models.WebhookProjection;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated webhook entity. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated webhook entity. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageWebhookProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<WebhookProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageWebhookProjection() {
}
public PageWebhookProjection content(List<WebhookProjection> content) {
this.content = content;
return this;
}
public PageWebhookProjection addContentItem(WebhookProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<WebhookProjection> getContent() {
return content;
}
public void setContent(List<WebhookProjection> content) {
this.content = content;
}
public PageWebhookProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageWebhookProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageWebhookProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageWebhookProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageWebhookProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageWebhookProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageWebhookProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageWebhookProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageWebhookProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageWebhookProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageWebhookProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageWebhookProjection pageWebhookProjection = (PageWebhookProjection) o;
return Objects.equals(this.content, pageWebhookProjection.content) &&
Objects.equals(this.pageable, pageWebhookProjection.pageable) &&
Objects.equals(this.total, pageWebhookProjection.total) &&
Objects.equals(this.totalElements, pageWebhookProjection.totalElements) &&
Objects.equals(this.totalPages, pageWebhookProjection.totalPages) &&
Objects.equals(this.last, pageWebhookProjection.last) &&
Objects.equals(this.size, pageWebhookProjection.size) &&
Objects.equals(this.number, pageWebhookProjection.number) &&
Objects.equals(this.sort, pageWebhookProjection.sort) &&
Objects.equals(this.numberOfElements, pageWebhookProjection.numberOfElements) &&
Objects.equals(this.first, pageWebhookProjection.first) &&
Objects.equals(this.empty, pageWebhookProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageWebhookProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageWebhookProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageWebhookProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageWebhookProjection is not found in the empty JSON string", PageWebhookProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageWebhookProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageWebhookProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
WebhookProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageWebhookProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageWebhookProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageWebhookProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageWebhookProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageWebhookProjection>() {
@Override
public void write(JsonWriter out, PageWebhookProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageWebhookProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageWebhookProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageWebhookProjection
* @throws IOException if the JSON string is invalid with respect to PageWebhookProjection
*/
public static PageWebhookProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageWebhookProjection.class);
}
/**
* Convert an instance of PageWebhookProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.Sort;
import com.mailslurp.models.UnknownMissedEmailProjection;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated unknown MissedEmail results. Unknown missed emails are emails that were sent to MailSlurp /Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated unknown MissedEmail results. Unknown missed emails are emails that were sent to MailSlurp /Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageUnknownMissedEmailProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<UnknownMissedEmailProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageUnknownMissedEmailProjection() {
}
public PageUnknownMissedEmailProjection content(List<UnknownMissedEmailProjection> content) {
this.content = content;
return this;
}
public PageUnknownMissedEmailProjection addContentItem(UnknownMissedEmailProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<UnknownMissedEmailProjection> getContent() {
return content;
}
public void setContent(List<UnknownMissedEmailProjection> content) {
this.content = content;
}
public PageUnknownMissedEmailProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageUnknownMissedEmailProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageUnknownMissedEmailProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageUnknownMissedEmailProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageUnknownMissedEmailProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageUnknownMissedEmailProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageUnknownMissedEmailProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageUnknownMissedEmailProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageUnknownMissedEmailProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageUnknownMissedEmailProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageUnknownMissedEmailProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageUnknownMissedEmailProjection pageUnknownMissedEmailProjection = (PageUnknownMissedEmailProjection) o;
return Objects.equals(this.content, pageUnknownMissedEmailProjection.content) &&
Objects.equals(this.pageable, pageUnknownMissedEmailProjection.pageable) &&
Objects.equals(this.total, pageUnknownMissedEmailProjection.total) &&
Objects.equals(this.totalElements, pageUnknownMissedEmailProjection.totalElements) &&
Objects.equals(this.totalPages, pageUnknownMissedEmailProjection.totalPages) &&
Objects.equals(this.last, pageUnknownMissedEmailProjection.last) &&
Objects.equals(this.size, pageUnknownMissedEmailProjection.size) &&
Objects.equals(this.number, pageUnknownMissedEmailProjection.number) &&
Objects.equals(this.sort, pageUnknownMissedEmailProjection.sort) &&
Objects.equals(this.numberOfElements, pageUnknownMissedEmailProjection.numberOfElements) &&
Objects.equals(this.first, pageUnknownMissedEmailProjection.first) &&
Objects.equals(this.empty, pageUnknownMissedEmailProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageUnknownMissedEmailProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageUnknownMissedEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageUnknownMissedEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageUnknownMissedEmailProjection is not found in the empty JSON string", PageUnknownMissedEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageUnknownMissedEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageUnknownMissedEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
UnknownMissedEmailProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageUnknownMissedEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageUnknownMissedEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageUnknownMissedEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageUnknownMissedEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageUnknownMissedEmailProjection>() {
@Override
public void write(JsonWriter out, PageUnknownMissedEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageUnknownMissedEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageUnknownMissedEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageUnknownMissedEmailProjection
* @throws IOException if the JSON string is invalid with respect to PageUnknownMissedEmailProjection
*/
public static PageUnknownMissedEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageUnknownMissedEmailProjection.class);
}
/**
* Convert an instance of PageUnknownMissedEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.Sort;
import com.mailslurp.models.TrackingPixelProjection;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated TrackingPixel results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated TrackingPixel results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageTrackingPixelProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<TrackingPixelProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageTrackingPixelProjection() {
}
public PageTrackingPixelProjection content(List<TrackingPixelProjection> content) {
this.content = content;
return this;
}
public PageTrackingPixelProjection addContentItem(TrackingPixelProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<TrackingPixelProjection> getContent() {
return content;
}
public void setContent(List<TrackingPixelProjection> content) {
this.content = content;
}
public PageTrackingPixelProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageTrackingPixelProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageTrackingPixelProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageTrackingPixelProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageTrackingPixelProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageTrackingPixelProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageTrackingPixelProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageTrackingPixelProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageTrackingPixelProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageTrackingPixelProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageTrackingPixelProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageTrackingPixelProjection pageTrackingPixelProjection = (PageTrackingPixelProjection) o;
return Objects.equals(this.content, pageTrackingPixelProjection.content) &&
Objects.equals(this.pageable, pageTrackingPixelProjection.pageable) &&
Objects.equals(this.total, pageTrackingPixelProjection.total) &&
Objects.equals(this.totalElements, pageTrackingPixelProjection.totalElements) &&
Objects.equals(this.totalPages, pageTrackingPixelProjection.totalPages) &&
Objects.equals(this.last, pageTrackingPixelProjection.last) &&
Objects.equals(this.size, pageTrackingPixelProjection.size) &&
Objects.equals(this.number, pageTrackingPixelProjection.number) &&
Objects.equals(this.sort, pageTrackingPixelProjection.sort) &&
Objects.equals(this.numberOfElements, pageTrackingPixelProjection.numberOfElements) &&
Objects.equals(this.first, pageTrackingPixelProjection.first) &&
Objects.equals(this.empty, pageTrackingPixelProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageTrackingPixelProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageTrackingPixelProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageTrackingPixelProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageTrackingPixelProjection is not found in the empty JSON string", PageTrackingPixelProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageTrackingPixelProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageTrackingPixelProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
TrackingPixelProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageTrackingPixelProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageTrackingPixelProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageTrackingPixelProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageTrackingPixelProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageTrackingPixelProjection>() {
@Override
public void write(JsonWriter out, PageTrackingPixelProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageTrackingPixelProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageTrackingPixelProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageTrackingPixelProjection
* @throws IOException if the JSON string is invalid with respect to PageTrackingPixelProjection
*/
public static PageTrackingPixelProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageTrackingPixelProjection.class);
}
/**
* Convert an instance of PageTrackingPixelProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.Sort;
import com.mailslurp.models.ThreadProjection;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.
*/
@ApiModel(description = "Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageThreadProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ThreadProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageThreadProjection() {
}
public PageThreadProjection content(List<ThreadProjection> content) {
this.content = content;
return this;
}
public PageThreadProjection addContentItem(ThreadProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ThreadProjection> getContent() {
return content;
}
public void setContent(List<ThreadProjection> content) {
this.content = content;
}
public PageThreadProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageThreadProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageThreadProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageThreadProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageThreadProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageThreadProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageThreadProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageThreadProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageThreadProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageThreadProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageThreadProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageThreadProjection pageThreadProjection = (PageThreadProjection) o;
return Objects.equals(this.content, pageThreadProjection.content) &&
Objects.equals(this.pageable, pageThreadProjection.pageable) &&
Objects.equals(this.total, pageThreadProjection.total) &&
Objects.equals(this.totalElements, pageThreadProjection.totalElements) &&
Objects.equals(this.totalPages, pageThreadProjection.totalPages) &&
Objects.equals(this.last, pageThreadProjection.last) &&
Objects.equals(this.size, pageThreadProjection.size) &&
Objects.equals(this.number, pageThreadProjection.number) &&
Objects.equals(this.sort, pageThreadProjection.sort) &&
Objects.equals(this.numberOfElements, pageThreadProjection.numberOfElements) &&
Objects.equals(this.first, pageThreadProjection.first) &&
Objects.equals(this.empty, pageThreadProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageThreadProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageThreadProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageThreadProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageThreadProjection is not found in the empty JSON string", PageThreadProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageThreadProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageThreadProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ThreadProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageThreadProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageThreadProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageThreadProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageThreadProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageThreadProjection>() {
@Override
public void write(JsonWriter out, PageThreadProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageThreadProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageThreadProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageThreadProjection
* @throws IOException if the JSON string is invalid with respect to PageThreadProjection
*/
public static PageThreadProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageThreadProjection.class);
}
/**
* Convert an instance of PageThreadProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.Sort;
import com.mailslurp.models.TemplateProjection;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated email template results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated email template results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageTemplateProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<TemplateProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageTemplateProjection() {
}
public PageTemplateProjection content(List<TemplateProjection> content) {
this.content = content;
return this;
}
public PageTemplateProjection addContentItem(TemplateProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<TemplateProjection> getContent() {
return content;
}
public void setContent(List<TemplateProjection> content) {
this.content = content;
}
public PageTemplateProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageTemplateProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageTemplateProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageTemplateProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageTemplateProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageTemplateProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageTemplateProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageTemplateProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageTemplateProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageTemplateProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageTemplateProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageTemplateProjection pageTemplateProjection = (PageTemplateProjection) o;
return Objects.equals(this.content, pageTemplateProjection.content) &&
Objects.equals(this.pageable, pageTemplateProjection.pageable) &&
Objects.equals(this.total, pageTemplateProjection.total) &&
Objects.equals(this.totalElements, pageTemplateProjection.totalElements) &&
Objects.equals(this.totalPages, pageTemplateProjection.totalPages) &&
Objects.equals(this.last, pageTemplateProjection.last) &&
Objects.equals(this.size, pageTemplateProjection.size) &&
Objects.equals(this.number, pageTemplateProjection.number) &&
Objects.equals(this.sort, pageTemplateProjection.sort) &&
Objects.equals(this.numberOfElements, pageTemplateProjection.numberOfElements) &&
Objects.equals(this.first, pageTemplateProjection.first) &&
Objects.equals(this.empty, pageTemplateProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageTemplateProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageTemplateProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageTemplateProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageTemplateProjection is not found in the empty JSON string", PageTemplateProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageTemplateProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageTemplateProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
TemplateProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageTemplateProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageTemplateProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageTemplateProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageTemplateProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageTemplateProjection>() {
@Override
public void write(JsonWriter out, PageTemplateProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageTemplateProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageTemplateProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageTemplateProjection
* @throws IOException if the JSON string is invalid with respect to PageTemplateProjection
*/
public static PageTemplateProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageTemplateProjection.class);
}
/**
* Convert an instance of PageTemplateProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.SmsProjection;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated SMS messages. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated SMS messages. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageSmsProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<SmsProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageSmsProjection() {
}
public PageSmsProjection content(List<SmsProjection> content) {
this.content = content;
return this;
}
public PageSmsProjection addContentItem(SmsProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<SmsProjection> getContent() {
return content;
}
public void setContent(List<SmsProjection> content) {
this.content = content;
}
public PageSmsProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageSmsProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageSmsProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageSmsProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageSmsProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageSmsProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageSmsProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageSmsProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageSmsProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageSmsProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageSmsProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageSmsProjection pageSmsProjection = (PageSmsProjection) o;
return Objects.equals(this.content, pageSmsProjection.content) &&
Objects.equals(this.pageable, pageSmsProjection.pageable) &&
Objects.equals(this.total, pageSmsProjection.total) &&
Objects.equals(this.totalElements, pageSmsProjection.totalElements) &&
Objects.equals(this.totalPages, pageSmsProjection.totalPages) &&
Objects.equals(this.last, pageSmsProjection.last) &&
Objects.equals(this.size, pageSmsProjection.size) &&
Objects.equals(this.number, pageSmsProjection.number) &&
Objects.equals(this.sort, pageSmsProjection.sort) &&
Objects.equals(this.numberOfElements, pageSmsProjection.numberOfElements) &&
Objects.equals(this.first, pageSmsProjection.first) &&
Objects.equals(this.empty, pageSmsProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageSmsProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageSmsProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageSmsProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageSmsProjection is not found in the empty JSON string", PageSmsProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageSmsProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageSmsProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
SmsProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageSmsProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageSmsProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageSmsProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageSmsProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageSmsProjection>() {
@Override
public void write(JsonWriter out, PageSmsProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageSmsProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageSmsProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageSmsProjection
* @throws IOException if the JSON string is invalid with respect to PageSmsProjection
*/
public static PageSmsProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageSmsProjection.class);
}
/**
* Convert an instance of PageSmsProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.SendWithQueueResult;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated sent email results for emails sent with queue. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full sent email entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated sent email results for emails sent with queue. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full sent email entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageSentEmailWithQueueProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<SendWithQueueResult> content = new ArrayList<>();
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageSentEmailWithQueueProjection() {
}
public PageSentEmailWithQueueProjection content(List<SendWithQueueResult> content) {
this.content = content;
return this;
}
public PageSentEmailWithQueueProjection addContentItem(SendWithQueueResult contentItem) {
this.content.add(contentItem);
return this;
}
/**
* Collection of items
* @return content
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Collection of items")
public List<SendWithQueueResult> getContent() {
return content;
}
public void setContent(List<SendWithQueueResult> content) {
this.content = content;
}
public PageSentEmailWithQueueProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageSentEmailWithQueueProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageSentEmailWithQueueProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Size of page requested
* @return size
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Size of page requested")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageSentEmailWithQueueProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Page number starting at 0
* @return number
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Page number starting at 0")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageSentEmailWithQueueProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Number of items returned
* @return numberOfElements
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Number of items returned")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageSentEmailWithQueueProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Total number of items available for querying
* @return totalElements
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Total number of items available for querying")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageSentEmailWithQueueProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Total number of pages available
* @return totalPages
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Total number of pages available")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageSentEmailWithQueueProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageSentEmailWithQueueProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageSentEmailWithQueueProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageSentEmailWithQueueProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageSentEmailWithQueueProjection pageSentEmailWithQueueProjection = (PageSentEmailWithQueueProjection) o;
return Objects.equals(this.content, pageSentEmailWithQueueProjection.content) &&
Objects.equals(this.pageable, pageSentEmailWithQueueProjection.pageable) &&
Objects.equals(this.total, pageSentEmailWithQueueProjection.total) &&
Objects.equals(this.size, pageSentEmailWithQueueProjection.size) &&
Objects.equals(this.number, pageSentEmailWithQueueProjection.number) &&
Objects.equals(this.numberOfElements, pageSentEmailWithQueueProjection.numberOfElements) &&
Objects.equals(this.totalElements, pageSentEmailWithQueueProjection.totalElements) &&
Objects.equals(this.totalPages, pageSentEmailWithQueueProjection.totalPages) &&
Objects.equals(this.last, pageSentEmailWithQueueProjection.last) &&
Objects.equals(this.sort, pageSentEmailWithQueueProjection.sort) &&
Objects.equals(this.first, pageSentEmailWithQueueProjection.first) &&
Objects.equals(this.empty, pageSentEmailWithQueueProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, size, number, numberOfElements, totalElements, totalPages, last, sort, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageSentEmailWithQueueProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("numberOfElements");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("sort");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("content");
openapiRequiredFields.add("size");
openapiRequiredFields.add("number");
openapiRequiredFields.add("numberOfElements");
openapiRequiredFields.add("totalElements");
openapiRequiredFields.add("totalPages");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageSentEmailWithQueueProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageSentEmailWithQueueProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageSentEmailWithQueueProjection is not found in the empty JSON string", PageSentEmailWithQueueProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageSentEmailWithQueueProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageSentEmailWithQueueProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : PageSentEmailWithQueueProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
// validate the required field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
SendWithQueueResult.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageSentEmailWithQueueProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageSentEmailWithQueueProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageSentEmailWithQueueProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageSentEmailWithQueueProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageSentEmailWithQueueProjection>() {
@Override
public void write(JsonWriter out, PageSentEmailWithQueueProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageSentEmailWithQueueProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageSentEmailWithQueueProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageSentEmailWithQueueProjection
* @throws IOException if the JSON string is invalid with respect to PageSentEmailWithQueueProjection
*/
public static PageSentEmailWithQueueProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageSentEmailWithQueueProjection.class);
}
/**
* Convert an instance of PageSentEmailWithQueueProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.SentEmailProjection;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated sent email results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full sent email entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated sent email results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full sent email entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageSentEmailProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<SentEmailProjection> content = new ArrayList<>();
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageSentEmailProjection() {
}
public PageSentEmailProjection content(List<SentEmailProjection> content) {
this.content = content;
return this;
}
public PageSentEmailProjection addContentItem(SentEmailProjection contentItem) {
this.content.add(contentItem);
return this;
}
/**
* Collection of items
* @return content
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Collection of items")
public List<SentEmailProjection> getContent() {
return content;
}
public void setContent(List<SentEmailProjection> content) {
this.content = content;
}
public PageSentEmailProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageSentEmailProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageSentEmailProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Size of page requested
* @return size
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Size of page requested")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageSentEmailProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Page number starting at 0
* @return number
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Page number starting at 0")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageSentEmailProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Number of items returned
* @return numberOfElements
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Number of items returned")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageSentEmailProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Total number of items available for querying
* @return totalElements
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Total number of items available for querying")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageSentEmailProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Total number of pages available
* @return totalPages
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Total number of pages available")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageSentEmailProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageSentEmailProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageSentEmailProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageSentEmailProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageSentEmailProjection pageSentEmailProjection = (PageSentEmailProjection) o;
return Objects.equals(this.content, pageSentEmailProjection.content) &&
Objects.equals(this.pageable, pageSentEmailProjection.pageable) &&
Objects.equals(this.total, pageSentEmailProjection.total) &&
Objects.equals(this.size, pageSentEmailProjection.size) &&
Objects.equals(this.number, pageSentEmailProjection.number) &&
Objects.equals(this.numberOfElements, pageSentEmailProjection.numberOfElements) &&
Objects.equals(this.totalElements, pageSentEmailProjection.totalElements) &&
Objects.equals(this.totalPages, pageSentEmailProjection.totalPages) &&
Objects.equals(this.last, pageSentEmailProjection.last) &&
Objects.equals(this.sort, pageSentEmailProjection.sort) &&
Objects.equals(this.first, pageSentEmailProjection.first) &&
Objects.equals(this.empty, pageSentEmailProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, size, number, numberOfElements, totalElements, totalPages, last, sort, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageSentEmailProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("numberOfElements");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("sort");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("content");
openapiRequiredFields.add("size");
openapiRequiredFields.add("number");
openapiRequiredFields.add("numberOfElements");
openapiRequiredFields.add("totalElements");
openapiRequiredFields.add("totalPages");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageSentEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageSentEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageSentEmailProjection is not found in the empty JSON string", PageSentEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageSentEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageSentEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : PageSentEmailProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
// validate the required field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
SentEmailProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageSentEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageSentEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageSentEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageSentEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageSentEmailProjection>() {
@Override
public void write(JsonWriter out, PageSentEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageSentEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageSentEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageSentEmailProjection
* @throws IOException if the JSON string is invalid with respect to PageSentEmailProjection
*/
public static PageSentEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageSentEmailProjection.class);
}
/**
* Convert an instance of PageSentEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.ScheduledJob;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated scheduled jobs results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated scheduled jobs results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageScheduledJobs {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ScheduledJob> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageScheduledJobs() {
}
public PageScheduledJobs content(List<ScheduledJob> content) {
this.content = content;
return this;
}
public PageScheduledJobs addContentItem(ScheduledJob contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ScheduledJob> getContent() {
return content;
}
public void setContent(List<ScheduledJob> content) {
this.content = content;
}
public PageScheduledJobs pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageScheduledJobs total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageScheduledJobs totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageScheduledJobs totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageScheduledJobs last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageScheduledJobs size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageScheduledJobs number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageScheduledJobs sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageScheduledJobs numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageScheduledJobs first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageScheduledJobs empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageScheduledJobs pageScheduledJobs = (PageScheduledJobs) o;
return Objects.equals(this.content, pageScheduledJobs.content) &&
Objects.equals(this.pageable, pageScheduledJobs.pageable) &&
Objects.equals(this.total, pageScheduledJobs.total) &&
Objects.equals(this.totalElements, pageScheduledJobs.totalElements) &&
Objects.equals(this.totalPages, pageScheduledJobs.totalPages) &&
Objects.equals(this.last, pageScheduledJobs.last) &&
Objects.equals(this.size, pageScheduledJobs.size) &&
Objects.equals(this.number, pageScheduledJobs.number) &&
Objects.equals(this.sort, pageScheduledJobs.sort) &&
Objects.equals(this.numberOfElements, pageScheduledJobs.numberOfElements) &&
Objects.equals(this.first, pageScheduledJobs.first) &&
Objects.equals(this.empty, pageScheduledJobs.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageScheduledJobs {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageScheduledJobs
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageScheduledJobs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageScheduledJobs is not found in the empty JSON string", PageScheduledJobs.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageScheduledJobs.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageScheduledJobs` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ScheduledJob.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageScheduledJobs.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageScheduledJobs' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageScheduledJobs> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageScheduledJobs.class));
return (TypeAdapter<T>) new TypeAdapter<PageScheduledJobs>() {
@Override
public void write(JsonWriter out, PageScheduledJobs value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageScheduledJobs read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageScheduledJobs given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageScheduledJobs
* @throws IOException if the JSON string is invalid with respect to PageScheduledJobs
*/
public static PageScheduledJobs fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageScheduledJobs.class);
}
/**
* Convert an instance of PageScheduledJobs to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.PageableObject;
import com.mailslurp.models.PhoneNumberProjection;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated phone numbers. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated phone numbers. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PagePhoneNumberProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<PhoneNumberProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PagePhoneNumberProjection() {
}
public PagePhoneNumberProjection content(List<PhoneNumberProjection> content) {
this.content = content;
return this;
}
public PagePhoneNumberProjection addContentItem(PhoneNumberProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<PhoneNumberProjection> getContent() {
return content;
}
public void setContent(List<PhoneNumberProjection> content) {
this.content = content;
}
public PagePhoneNumberProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PagePhoneNumberProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PagePhoneNumberProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PagePhoneNumberProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PagePhoneNumberProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PagePhoneNumberProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PagePhoneNumberProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PagePhoneNumberProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PagePhoneNumberProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PagePhoneNumberProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PagePhoneNumberProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PagePhoneNumberProjection pagePhoneNumberProjection = (PagePhoneNumberProjection) o;
return Objects.equals(this.content, pagePhoneNumberProjection.content) &&
Objects.equals(this.pageable, pagePhoneNumberProjection.pageable) &&
Objects.equals(this.total, pagePhoneNumberProjection.total) &&
Objects.equals(this.totalElements, pagePhoneNumberProjection.totalElements) &&
Objects.equals(this.totalPages, pagePhoneNumberProjection.totalPages) &&
Objects.equals(this.last, pagePhoneNumberProjection.last) &&
Objects.equals(this.size, pagePhoneNumberProjection.size) &&
Objects.equals(this.number, pagePhoneNumberProjection.number) &&
Objects.equals(this.sort, pagePhoneNumberProjection.sort) &&
Objects.equals(this.numberOfElements, pagePhoneNumberProjection.numberOfElements) &&
Objects.equals(this.first, pagePhoneNumberProjection.first) &&
Objects.equals(this.empty, pagePhoneNumberProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PagePhoneNumberProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PagePhoneNumberProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PagePhoneNumberProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PagePhoneNumberProjection is not found in the empty JSON string", PagePhoneNumberProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PagePhoneNumberProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PagePhoneNumberProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
PhoneNumberProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PagePhoneNumberProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PagePhoneNumberProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PagePhoneNumberProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PagePhoneNumberProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PagePhoneNumberProjection>() {
@Override
public void write(JsonWriter out, PagePhoneNumberProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PagePhoneNumberProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PagePhoneNumberProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PagePhoneNumberProjection
* @throws IOException if the JSON string is invalid with respect to PagePhoneNumberProjection
*/
public static PagePhoneNumberProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PagePhoneNumberProjection.class);
}
/**
* Convert an instance of PagePhoneNumberProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.OrganizationInboxProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated organization inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated organization inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageOrganizationInboxProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<OrganizationInboxProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageOrganizationInboxProjection() {
}
public PageOrganizationInboxProjection content(List<OrganizationInboxProjection> content) {
this.content = content;
return this;
}
public PageOrganizationInboxProjection addContentItem(OrganizationInboxProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<OrganizationInboxProjection> getContent() {
return content;
}
public void setContent(List<OrganizationInboxProjection> content) {
this.content = content;
}
public PageOrganizationInboxProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageOrganizationInboxProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageOrganizationInboxProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageOrganizationInboxProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageOrganizationInboxProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageOrganizationInboxProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageOrganizationInboxProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageOrganizationInboxProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageOrganizationInboxProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageOrganizationInboxProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageOrganizationInboxProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageOrganizationInboxProjection pageOrganizationInboxProjection = (PageOrganizationInboxProjection) o;
return Objects.equals(this.content, pageOrganizationInboxProjection.content) &&
Objects.equals(this.pageable, pageOrganizationInboxProjection.pageable) &&
Objects.equals(this.total, pageOrganizationInboxProjection.total) &&
Objects.equals(this.totalElements, pageOrganizationInboxProjection.totalElements) &&
Objects.equals(this.totalPages, pageOrganizationInboxProjection.totalPages) &&
Objects.equals(this.last, pageOrganizationInboxProjection.last) &&
Objects.equals(this.size, pageOrganizationInboxProjection.size) &&
Objects.equals(this.number, pageOrganizationInboxProjection.number) &&
Objects.equals(this.sort, pageOrganizationInboxProjection.sort) &&
Objects.equals(this.numberOfElements, pageOrganizationInboxProjection.numberOfElements) &&
Objects.equals(this.first, pageOrganizationInboxProjection.first) &&
Objects.equals(this.empty, pageOrganizationInboxProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageOrganizationInboxProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageOrganizationInboxProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageOrganizationInboxProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageOrganizationInboxProjection is not found in the empty JSON string", PageOrganizationInboxProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageOrganizationInboxProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageOrganizationInboxProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
OrganizationInboxProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageOrganizationInboxProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageOrganizationInboxProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageOrganizationInboxProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageOrganizationInboxProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageOrganizationInboxProjection>() {
@Override
public void write(JsonWriter out, PageOrganizationInboxProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageOrganizationInboxProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageOrganizationInboxProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageOrganizationInboxProjection
* @throws IOException if the JSON string is invalid with respect to PageOrganizationInboxProjection
*/
public static PageOrganizationInboxProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageOrganizationInboxProjection.class);
}
/**
* Convert an instance of PageOrganizationInboxProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.MissedEmailProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated MissedEmail results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated MissedEmail results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageMissedEmailProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<MissedEmailProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageMissedEmailProjection() {
}
public PageMissedEmailProjection content(List<MissedEmailProjection> content) {
this.content = content;
return this;
}
public PageMissedEmailProjection addContentItem(MissedEmailProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<MissedEmailProjection> getContent() {
return content;
}
public void setContent(List<MissedEmailProjection> content) {
this.content = content;
}
public PageMissedEmailProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageMissedEmailProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageMissedEmailProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageMissedEmailProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageMissedEmailProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageMissedEmailProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageMissedEmailProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageMissedEmailProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageMissedEmailProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageMissedEmailProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageMissedEmailProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageMissedEmailProjection pageMissedEmailProjection = (PageMissedEmailProjection) o;
return Objects.equals(this.content, pageMissedEmailProjection.content) &&
Objects.equals(this.pageable, pageMissedEmailProjection.pageable) &&
Objects.equals(this.total, pageMissedEmailProjection.total) &&
Objects.equals(this.totalElements, pageMissedEmailProjection.totalElements) &&
Objects.equals(this.totalPages, pageMissedEmailProjection.totalPages) &&
Objects.equals(this.last, pageMissedEmailProjection.last) &&
Objects.equals(this.size, pageMissedEmailProjection.size) &&
Objects.equals(this.number, pageMissedEmailProjection.number) &&
Objects.equals(this.sort, pageMissedEmailProjection.sort) &&
Objects.equals(this.numberOfElements, pageMissedEmailProjection.numberOfElements) &&
Objects.equals(this.first, pageMissedEmailProjection.first) &&
Objects.equals(this.empty, pageMissedEmailProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageMissedEmailProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageMissedEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageMissedEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageMissedEmailProjection is not found in the empty JSON string", PageMissedEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageMissedEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageMissedEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
MissedEmailProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageMissedEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageMissedEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageMissedEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageMissedEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageMissedEmailProjection>() {
@Override
public void write(JsonWriter out, PageMissedEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageMissedEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageMissedEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageMissedEmailProjection
* @throws IOException if the JSON string is invalid with respect to PageMissedEmailProjection
*/
public static PageMissedEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageMissedEmailProjection.class);
}
/**
* Convert an instance of PageMissedEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ListUnsubscribeRecipientProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated list unsubscribe recipients. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated list unsubscribe recipients. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageListUnsubscribeRecipients {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ListUnsubscribeRecipientProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageListUnsubscribeRecipients() {
}
public PageListUnsubscribeRecipients content(List<ListUnsubscribeRecipientProjection> content) {
this.content = content;
return this;
}
public PageListUnsubscribeRecipients addContentItem(ListUnsubscribeRecipientProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ListUnsubscribeRecipientProjection> getContent() {
return content;
}
public void setContent(List<ListUnsubscribeRecipientProjection> content) {
this.content = content;
}
public PageListUnsubscribeRecipients pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageListUnsubscribeRecipients total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageListUnsubscribeRecipients totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageListUnsubscribeRecipients totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageListUnsubscribeRecipients last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageListUnsubscribeRecipients size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageListUnsubscribeRecipients number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageListUnsubscribeRecipients sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageListUnsubscribeRecipients numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageListUnsubscribeRecipients first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageListUnsubscribeRecipients empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageListUnsubscribeRecipients pageListUnsubscribeRecipients = (PageListUnsubscribeRecipients) o;
return Objects.equals(this.content, pageListUnsubscribeRecipients.content) &&
Objects.equals(this.pageable, pageListUnsubscribeRecipients.pageable) &&
Objects.equals(this.total, pageListUnsubscribeRecipients.total) &&
Objects.equals(this.totalElements, pageListUnsubscribeRecipients.totalElements) &&
Objects.equals(this.totalPages, pageListUnsubscribeRecipients.totalPages) &&
Objects.equals(this.last, pageListUnsubscribeRecipients.last) &&
Objects.equals(this.size, pageListUnsubscribeRecipients.size) &&
Objects.equals(this.number, pageListUnsubscribeRecipients.number) &&
Objects.equals(this.sort, pageListUnsubscribeRecipients.sort) &&
Objects.equals(this.numberOfElements, pageListUnsubscribeRecipients.numberOfElements) &&
Objects.equals(this.first, pageListUnsubscribeRecipients.first) &&
Objects.equals(this.empty, pageListUnsubscribeRecipients.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageListUnsubscribeRecipients {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageListUnsubscribeRecipients
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageListUnsubscribeRecipients.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageListUnsubscribeRecipients is not found in the empty JSON string", PageListUnsubscribeRecipients.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageListUnsubscribeRecipients.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageListUnsubscribeRecipients` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ListUnsubscribeRecipientProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageListUnsubscribeRecipients.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageListUnsubscribeRecipients' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageListUnsubscribeRecipients> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageListUnsubscribeRecipients.class));
return (TypeAdapter<T>) new TypeAdapter<PageListUnsubscribeRecipients>() {
@Override
public void write(JsonWriter out, PageListUnsubscribeRecipients value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageListUnsubscribeRecipients read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageListUnsubscribeRecipients given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageListUnsubscribeRecipients
* @throws IOException if the JSON string is invalid with respect to PageListUnsubscribeRecipients
*/
public static PageListUnsubscribeRecipients fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageListUnsubscribeRecipients.class);
}
/**
* Convert an instance of PageListUnsubscribeRecipients to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxRulesetDto;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox ruleset results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox ruleset results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageInboxRulesetDto {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<InboxRulesetDto> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageInboxRulesetDto() {
}
public PageInboxRulesetDto content(List<InboxRulesetDto> content) {
this.content = content;
return this;
}
public PageInboxRulesetDto addContentItem(InboxRulesetDto contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<InboxRulesetDto> getContent() {
return content;
}
public void setContent(List<InboxRulesetDto> content) {
this.content = content;
}
public PageInboxRulesetDto pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageInboxRulesetDto total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageInboxRulesetDto totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageInboxRulesetDto totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageInboxRulesetDto last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageInboxRulesetDto size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageInboxRulesetDto number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageInboxRulesetDto sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageInboxRulesetDto numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageInboxRulesetDto first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageInboxRulesetDto empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageInboxRulesetDto pageInboxRulesetDto = (PageInboxRulesetDto) o;
return Objects.equals(this.content, pageInboxRulesetDto.content) &&
Objects.equals(this.pageable, pageInboxRulesetDto.pageable) &&
Objects.equals(this.total, pageInboxRulesetDto.total) &&
Objects.equals(this.totalElements, pageInboxRulesetDto.totalElements) &&
Objects.equals(this.totalPages, pageInboxRulesetDto.totalPages) &&
Objects.equals(this.last, pageInboxRulesetDto.last) &&
Objects.equals(this.size, pageInboxRulesetDto.size) &&
Objects.equals(this.number, pageInboxRulesetDto.number) &&
Objects.equals(this.sort, pageInboxRulesetDto.sort) &&
Objects.equals(this.numberOfElements, pageInboxRulesetDto.numberOfElements) &&
Objects.equals(this.first, pageInboxRulesetDto.first) &&
Objects.equals(this.empty, pageInboxRulesetDto.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageInboxRulesetDto {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageInboxRulesetDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageInboxRulesetDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageInboxRulesetDto is not found in the empty JSON string", PageInboxRulesetDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageInboxRulesetDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageInboxRulesetDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
InboxRulesetDto.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageInboxRulesetDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageInboxRulesetDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageInboxRulesetDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageInboxRulesetDto.class));
return (TypeAdapter<T>) new TypeAdapter<PageInboxRulesetDto>() {
@Override
public void write(JsonWriter out, PageInboxRulesetDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageInboxRulesetDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageInboxRulesetDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageInboxRulesetDto
* @throws IOException if the JSON string is invalid with respect to PageInboxRulesetDto
*/
public static PageInboxRulesetDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageInboxRulesetDto.class);
}
/**
* Convert an instance of PageInboxRulesetDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxReplierEventProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox replier events. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox replier events. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageInboxReplierEvents {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<InboxReplierEventProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageInboxReplierEvents() {
}
public PageInboxReplierEvents content(List<InboxReplierEventProjection> content) {
this.content = content;
return this;
}
public PageInboxReplierEvents addContentItem(InboxReplierEventProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<InboxReplierEventProjection> getContent() {
return content;
}
public void setContent(List<InboxReplierEventProjection> content) {
this.content = content;
}
public PageInboxReplierEvents pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageInboxReplierEvents total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageInboxReplierEvents totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageInboxReplierEvents totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageInboxReplierEvents last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageInboxReplierEvents size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageInboxReplierEvents number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageInboxReplierEvents sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageInboxReplierEvents numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageInboxReplierEvents first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageInboxReplierEvents empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageInboxReplierEvents pageInboxReplierEvents = (PageInboxReplierEvents) o;
return Objects.equals(this.content, pageInboxReplierEvents.content) &&
Objects.equals(this.pageable, pageInboxReplierEvents.pageable) &&
Objects.equals(this.total, pageInboxReplierEvents.total) &&
Objects.equals(this.totalElements, pageInboxReplierEvents.totalElements) &&
Objects.equals(this.totalPages, pageInboxReplierEvents.totalPages) &&
Objects.equals(this.last, pageInboxReplierEvents.last) &&
Objects.equals(this.size, pageInboxReplierEvents.size) &&
Objects.equals(this.number, pageInboxReplierEvents.number) &&
Objects.equals(this.sort, pageInboxReplierEvents.sort) &&
Objects.equals(this.numberOfElements, pageInboxReplierEvents.numberOfElements) &&
Objects.equals(this.first, pageInboxReplierEvents.first) &&
Objects.equals(this.empty, pageInboxReplierEvents.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageInboxReplierEvents {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageInboxReplierEvents
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageInboxReplierEvents.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageInboxReplierEvents is not found in the empty JSON string", PageInboxReplierEvents.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageInboxReplierEvents.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageInboxReplierEvents` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
InboxReplierEventProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageInboxReplierEvents.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageInboxReplierEvents' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageInboxReplierEvents> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageInboxReplierEvents.class));
return (TypeAdapter<T>) new TypeAdapter<PageInboxReplierEvents>() {
@Override
public void write(JsonWriter out, PageInboxReplierEvents value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageInboxReplierEvents read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageInboxReplierEvents given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageInboxReplierEvents
* @throws IOException if the JSON string is invalid with respect to PageInboxReplierEvents
*/
public static PageInboxReplierEvents fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageInboxReplierEvents.class);
}
/**
* Convert an instance of PageInboxReplierEvents to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxReplierDto;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox replier results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox replier results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageInboxReplierDto {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<InboxReplierDto> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageInboxReplierDto() {
}
public PageInboxReplierDto content(List<InboxReplierDto> content) {
this.content = content;
return this;
}
public PageInboxReplierDto addContentItem(InboxReplierDto contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<InboxReplierDto> getContent() {
return content;
}
public void setContent(List<InboxReplierDto> content) {
this.content = content;
}
public PageInboxReplierDto pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageInboxReplierDto total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageInboxReplierDto totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageInboxReplierDto totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageInboxReplierDto last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageInboxReplierDto size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageInboxReplierDto number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageInboxReplierDto sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageInboxReplierDto numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageInboxReplierDto first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageInboxReplierDto empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageInboxReplierDto pageInboxReplierDto = (PageInboxReplierDto) o;
return Objects.equals(this.content, pageInboxReplierDto.content) &&
Objects.equals(this.pageable, pageInboxReplierDto.pageable) &&
Objects.equals(this.total, pageInboxReplierDto.total) &&
Objects.equals(this.totalElements, pageInboxReplierDto.totalElements) &&
Objects.equals(this.totalPages, pageInboxReplierDto.totalPages) &&
Objects.equals(this.last, pageInboxReplierDto.last) &&
Objects.equals(this.size, pageInboxReplierDto.size) &&
Objects.equals(this.number, pageInboxReplierDto.number) &&
Objects.equals(this.sort, pageInboxReplierDto.sort) &&
Objects.equals(this.numberOfElements, pageInboxReplierDto.numberOfElements) &&
Objects.equals(this.first, pageInboxReplierDto.first) &&
Objects.equals(this.empty, pageInboxReplierDto.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageInboxReplierDto {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageInboxReplierDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageInboxReplierDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageInboxReplierDto is not found in the empty JSON string", PageInboxReplierDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageInboxReplierDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageInboxReplierDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
InboxReplierDto.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageInboxReplierDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageInboxReplierDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageInboxReplierDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageInboxReplierDto.class));
return (TypeAdapter<T>) new TypeAdapter<PageInboxReplierDto>() {
@Override
public void write(JsonWriter out, PageInboxReplierDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageInboxReplierDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageInboxReplierDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageInboxReplierDto
* @throws IOException if the JSON string is invalid with respect to PageInboxReplierDto
*/
public static PageInboxReplierDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageInboxReplierDto.class);
}
/**
* Convert an instance of PageInboxReplierDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxPreview;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageInboxProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<InboxPreview> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageInboxProjection() {
}
public PageInboxProjection content(List<InboxPreview> content) {
this.content = content;
return this;
}
public PageInboxProjection addContentItem(InboxPreview contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<InboxPreview> getContent() {
return content;
}
public void setContent(List<InboxPreview> content) {
this.content = content;
}
public PageInboxProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageInboxProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageInboxProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageInboxProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageInboxProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageInboxProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageInboxProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageInboxProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageInboxProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageInboxProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageInboxProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageInboxProjection pageInboxProjection = (PageInboxProjection) o;
return Objects.equals(this.content, pageInboxProjection.content) &&
Objects.equals(this.pageable, pageInboxProjection.pageable) &&
Objects.equals(this.total, pageInboxProjection.total) &&
Objects.equals(this.totalElements, pageInboxProjection.totalElements) &&
Objects.equals(this.totalPages, pageInboxProjection.totalPages) &&
Objects.equals(this.last, pageInboxProjection.last) &&
Objects.equals(this.size, pageInboxProjection.size) &&
Objects.equals(this.number, pageInboxProjection.number) &&
Objects.equals(this.sort, pageInboxProjection.sort) &&
Objects.equals(this.numberOfElements, pageInboxProjection.numberOfElements) &&
Objects.equals(this.first, pageInboxProjection.first) &&
Objects.equals(this.empty, pageInboxProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageInboxProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageInboxProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageInboxProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageInboxProjection is not found in the empty JSON string", PageInboxProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageInboxProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageInboxProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
InboxPreview.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageInboxProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageInboxProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageInboxProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageInboxProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageInboxProjection>() {
@Override
public void write(JsonWriter out, PageInboxProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageInboxProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageInboxProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageInboxProjection
* @throws IOException if the JSON string is invalid with respect to PageInboxProjection
*/
public static PageInboxProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageInboxProjection.class);
}
/**
* Convert an instance of PageInboxProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxForwarderEventProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox forwarder events. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox forwarder events. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageInboxForwarderEvents {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<InboxForwarderEventProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageInboxForwarderEvents() {
}
public PageInboxForwarderEvents content(List<InboxForwarderEventProjection> content) {
this.content = content;
return this;
}
public PageInboxForwarderEvents addContentItem(InboxForwarderEventProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<InboxForwarderEventProjection> getContent() {
return content;
}
public void setContent(List<InboxForwarderEventProjection> content) {
this.content = content;
}
public PageInboxForwarderEvents pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageInboxForwarderEvents total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageInboxForwarderEvents totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageInboxForwarderEvents totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageInboxForwarderEvents last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageInboxForwarderEvents size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageInboxForwarderEvents number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageInboxForwarderEvents sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageInboxForwarderEvents numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageInboxForwarderEvents first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageInboxForwarderEvents empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageInboxForwarderEvents pageInboxForwarderEvents = (PageInboxForwarderEvents) o;
return Objects.equals(this.content, pageInboxForwarderEvents.content) &&
Objects.equals(this.pageable, pageInboxForwarderEvents.pageable) &&
Objects.equals(this.total, pageInboxForwarderEvents.total) &&
Objects.equals(this.totalElements, pageInboxForwarderEvents.totalElements) &&
Objects.equals(this.totalPages, pageInboxForwarderEvents.totalPages) &&
Objects.equals(this.last, pageInboxForwarderEvents.last) &&
Objects.equals(this.size, pageInboxForwarderEvents.size) &&
Objects.equals(this.number, pageInboxForwarderEvents.number) &&
Objects.equals(this.sort, pageInboxForwarderEvents.sort) &&
Objects.equals(this.numberOfElements, pageInboxForwarderEvents.numberOfElements) &&
Objects.equals(this.first, pageInboxForwarderEvents.first) &&
Objects.equals(this.empty, pageInboxForwarderEvents.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageInboxForwarderEvents {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageInboxForwarderEvents
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageInboxForwarderEvents.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageInboxForwarderEvents is not found in the empty JSON string", PageInboxForwarderEvents.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageInboxForwarderEvents.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageInboxForwarderEvents` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
InboxForwarderEventProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageInboxForwarderEvents.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageInboxForwarderEvents' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageInboxForwarderEvents> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageInboxForwarderEvents.class));
return (TypeAdapter<T>) new TypeAdapter<PageInboxForwarderEvents>() {
@Override
public void write(JsonWriter out, PageInboxForwarderEvents value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageInboxForwarderEvents read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageInboxForwarderEvents given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageInboxForwarderEvents
* @throws IOException if the JSON string is invalid with respect to PageInboxForwarderEvents
*/
public static PageInboxForwarderEvents fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageInboxForwarderEvents.class);
}
/**
* Convert an instance of PageInboxForwarderEvents to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxForwarderDto;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox forwarder results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox forwarder results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageInboxForwarderDto {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<InboxForwarderDto> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageInboxForwarderDto() {
}
public PageInboxForwarderDto content(List<InboxForwarderDto> content) {
this.content = content;
return this;
}
public PageInboxForwarderDto addContentItem(InboxForwarderDto contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<InboxForwarderDto> getContent() {
return content;
}
public void setContent(List<InboxForwarderDto> content) {
this.content = content;
}
public PageInboxForwarderDto pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageInboxForwarderDto total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageInboxForwarderDto totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageInboxForwarderDto totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageInboxForwarderDto last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageInboxForwarderDto size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageInboxForwarderDto number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageInboxForwarderDto sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageInboxForwarderDto numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageInboxForwarderDto first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageInboxForwarderDto empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageInboxForwarderDto pageInboxForwarderDto = (PageInboxForwarderDto) o;
return Objects.equals(this.content, pageInboxForwarderDto.content) &&
Objects.equals(this.pageable, pageInboxForwarderDto.pageable) &&
Objects.equals(this.total, pageInboxForwarderDto.total) &&
Objects.equals(this.totalElements, pageInboxForwarderDto.totalElements) &&
Objects.equals(this.totalPages, pageInboxForwarderDto.totalPages) &&
Objects.equals(this.last, pageInboxForwarderDto.last) &&
Objects.equals(this.size, pageInboxForwarderDto.size) &&
Objects.equals(this.number, pageInboxForwarderDto.number) &&
Objects.equals(this.sort, pageInboxForwarderDto.sort) &&
Objects.equals(this.numberOfElements, pageInboxForwarderDto.numberOfElements) &&
Objects.equals(this.first, pageInboxForwarderDto.first) &&
Objects.equals(this.empty, pageInboxForwarderDto.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageInboxForwarderDto {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageInboxForwarderDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageInboxForwarderDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageInboxForwarderDto is not found in the empty JSON string", PageInboxForwarderDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageInboxForwarderDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageInboxForwarderDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
InboxForwarderDto.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageInboxForwarderDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageInboxForwarderDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageInboxForwarderDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageInboxForwarderDto.class));
return (TypeAdapter<T>) new TypeAdapter<PageInboxForwarderDto>() {
@Override
public void write(JsonWriter out, PageInboxForwarderDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageInboxForwarderDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageInboxForwarderDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageInboxForwarderDto
* @throws IOException if the JSON string is invalid with respect to PageInboxForwarderDto
*/
public static PageInboxForwarderDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageInboxForwarderDto.class);
}
/**
* Convert an instance of PageInboxForwarderDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.GroupProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated missed email results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated missed email results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageGroupProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<GroupProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageGroupProjection() {
}
public PageGroupProjection content(List<GroupProjection> content) {
this.content = content;
return this;
}
public PageGroupProjection addContentItem(GroupProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<GroupProjection> getContent() {
return content;
}
public void setContent(List<GroupProjection> content) {
this.content = content;
}
public PageGroupProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageGroupProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageGroupProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageGroupProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageGroupProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageGroupProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageGroupProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageGroupProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageGroupProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageGroupProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageGroupProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageGroupProjection pageGroupProjection = (PageGroupProjection) o;
return Objects.equals(this.content, pageGroupProjection.content) &&
Objects.equals(this.pageable, pageGroupProjection.pageable) &&
Objects.equals(this.total, pageGroupProjection.total) &&
Objects.equals(this.totalElements, pageGroupProjection.totalElements) &&
Objects.equals(this.totalPages, pageGroupProjection.totalPages) &&
Objects.equals(this.last, pageGroupProjection.last) &&
Objects.equals(this.size, pageGroupProjection.size) &&
Objects.equals(this.number, pageGroupProjection.number) &&
Objects.equals(this.sort, pageGroupProjection.sort) &&
Objects.equals(this.numberOfElements, pageGroupProjection.numberOfElements) &&
Objects.equals(this.first, pageGroupProjection.first) &&
Objects.equals(this.empty, pageGroupProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageGroupProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageGroupProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageGroupProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageGroupProjection is not found in the empty JSON string", PageGroupProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageGroupProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageGroupProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
GroupProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageGroupProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageGroupProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageGroupProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageGroupProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageGroupProjection>() {
@Override
public void write(JsonWriter out, PageGroupProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageGroupProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageGroupProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageGroupProjection
* @throws IOException if the JSON string is invalid with respect to PageGroupProjection
*/
public static PageGroupProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageGroupProjection.class);
}
/**
* Convert an instance of PageGroupProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ExpiredInboxRecordProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated expired inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated expired inbox results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageExpiredInboxRecordProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ExpiredInboxRecordProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageExpiredInboxRecordProjection() {
}
public PageExpiredInboxRecordProjection content(List<ExpiredInboxRecordProjection> content) {
this.content = content;
return this;
}
public PageExpiredInboxRecordProjection addContentItem(ExpiredInboxRecordProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ExpiredInboxRecordProjection> getContent() {
return content;
}
public void setContent(List<ExpiredInboxRecordProjection> content) {
this.content = content;
}
public PageExpiredInboxRecordProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageExpiredInboxRecordProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageExpiredInboxRecordProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageExpiredInboxRecordProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageExpiredInboxRecordProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageExpiredInboxRecordProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageExpiredInboxRecordProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageExpiredInboxRecordProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageExpiredInboxRecordProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageExpiredInboxRecordProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageExpiredInboxRecordProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageExpiredInboxRecordProjection pageExpiredInboxRecordProjection = (PageExpiredInboxRecordProjection) o;
return Objects.equals(this.content, pageExpiredInboxRecordProjection.content) &&
Objects.equals(this.pageable, pageExpiredInboxRecordProjection.pageable) &&
Objects.equals(this.total, pageExpiredInboxRecordProjection.total) &&
Objects.equals(this.totalElements, pageExpiredInboxRecordProjection.totalElements) &&
Objects.equals(this.totalPages, pageExpiredInboxRecordProjection.totalPages) &&
Objects.equals(this.last, pageExpiredInboxRecordProjection.last) &&
Objects.equals(this.size, pageExpiredInboxRecordProjection.size) &&
Objects.equals(this.number, pageExpiredInboxRecordProjection.number) &&
Objects.equals(this.sort, pageExpiredInboxRecordProjection.sort) &&
Objects.equals(this.numberOfElements, pageExpiredInboxRecordProjection.numberOfElements) &&
Objects.equals(this.first, pageExpiredInboxRecordProjection.first) &&
Objects.equals(this.empty, pageExpiredInboxRecordProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageExpiredInboxRecordProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageExpiredInboxRecordProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageExpiredInboxRecordProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageExpiredInboxRecordProjection is not found in the empty JSON string", PageExpiredInboxRecordProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageExpiredInboxRecordProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageExpiredInboxRecordProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ExpiredInboxRecordProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageExpiredInboxRecordProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageExpiredInboxRecordProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageExpiredInboxRecordProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageExpiredInboxRecordProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageExpiredInboxRecordProjection>() {
@Override
public void write(JsonWriter out, PageExpiredInboxRecordProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageExpiredInboxRecordProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageExpiredInboxRecordProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageExpiredInboxRecordProjection
* @throws IOException if the JSON string is invalid with respect to PageExpiredInboxRecordProjection
*/
public static PageExpiredInboxRecordProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageExpiredInboxRecordProjection.class);
}
/**
* Convert an instance of PageExpiredInboxRecordProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.EmailValidationRequestDto;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated email validation request records. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated email validation request records. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageEmailValidationRequest {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<EmailValidationRequestDto> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageEmailValidationRequest() {
}
public PageEmailValidationRequest content(List<EmailValidationRequestDto> content) {
this.content = content;
return this;
}
public PageEmailValidationRequest addContentItem(EmailValidationRequestDto contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<EmailValidationRequestDto> getContent() {
return content;
}
public void setContent(List<EmailValidationRequestDto> content) {
this.content = content;
}
public PageEmailValidationRequest pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageEmailValidationRequest total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageEmailValidationRequest totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageEmailValidationRequest totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageEmailValidationRequest last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageEmailValidationRequest size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageEmailValidationRequest number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageEmailValidationRequest sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageEmailValidationRequest numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageEmailValidationRequest first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageEmailValidationRequest empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageEmailValidationRequest pageEmailValidationRequest = (PageEmailValidationRequest) o;
return Objects.equals(this.content, pageEmailValidationRequest.content) &&
Objects.equals(this.pageable, pageEmailValidationRequest.pageable) &&
Objects.equals(this.total, pageEmailValidationRequest.total) &&
Objects.equals(this.totalElements, pageEmailValidationRequest.totalElements) &&
Objects.equals(this.totalPages, pageEmailValidationRequest.totalPages) &&
Objects.equals(this.last, pageEmailValidationRequest.last) &&
Objects.equals(this.size, pageEmailValidationRequest.size) &&
Objects.equals(this.number, pageEmailValidationRequest.number) &&
Objects.equals(this.sort, pageEmailValidationRequest.sort) &&
Objects.equals(this.numberOfElements, pageEmailValidationRequest.numberOfElements) &&
Objects.equals(this.first, pageEmailValidationRequest.first) &&
Objects.equals(this.empty, pageEmailValidationRequest.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageEmailValidationRequest {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageEmailValidationRequest
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageEmailValidationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageEmailValidationRequest is not found in the empty JSON string", PageEmailValidationRequest.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageEmailValidationRequest.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageEmailValidationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
EmailValidationRequestDto.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageEmailValidationRequest.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageEmailValidationRequest' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageEmailValidationRequest> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageEmailValidationRequest.class));
return (TypeAdapter<T>) new TypeAdapter<PageEmailValidationRequest>() {
@Override
public void write(JsonWriter out, PageEmailValidationRequest value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageEmailValidationRequest read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageEmailValidationRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageEmailValidationRequest
* @throws IOException if the JSON string is invalid with respect to PageEmailValidationRequest
*/
public static PageEmailValidationRequest fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageEmailValidationRequest.class);
}
/**
* Convert an instance of PageEmailValidationRequest to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.EmailProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.
*/
@ApiModel(description = "Paginated email projection results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full email entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageEmailProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<EmailProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageEmailProjection() {
}
public PageEmailProjection content(List<EmailProjection> content) {
this.content = content;
return this;
}
public PageEmailProjection addContentItem(EmailProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<EmailProjection> getContent() {
return content;
}
public void setContent(List<EmailProjection> content) {
this.content = content;
}
public PageEmailProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageEmailProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageEmailProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageEmailProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageEmailProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageEmailProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageEmailProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageEmailProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageEmailProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageEmailProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageEmailProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageEmailProjection pageEmailProjection = (PageEmailProjection) o;
return Objects.equals(this.content, pageEmailProjection.content) &&
Objects.equals(this.pageable, pageEmailProjection.pageable) &&
Objects.equals(this.total, pageEmailProjection.total) &&
Objects.equals(this.totalElements, pageEmailProjection.totalElements) &&
Objects.equals(this.totalPages, pageEmailProjection.totalPages) &&
Objects.equals(this.last, pageEmailProjection.last) &&
Objects.equals(this.size, pageEmailProjection.size) &&
Objects.equals(this.number, pageEmailProjection.number) &&
Objects.equals(this.sort, pageEmailProjection.sort) &&
Objects.equals(this.numberOfElements, pageEmailProjection.numberOfElements) &&
Objects.equals(this.first, pageEmailProjection.first) &&
Objects.equals(this.empty, pageEmailProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageEmailProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageEmailProjection is not found in the empty JSON string", PageEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
EmailProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageEmailProjection>() {
@Override
public void write(JsonWriter out, PageEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageEmailProjection
* @throws IOException if the JSON string is invalid with respect to PageEmailProjection
*/
public static PageEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageEmailProjection.class);
}
/**
* Convert an instance of PageEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.EmailPreview;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated email preview results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.
*/
@ApiModel(description = "Paginated email preview results. EmailProjections and EmailPreviews are essentially the same but have legacy naming issues. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls. For emails there are several methods for fetching message bodies and attachments.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageEmailPreview {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<EmailPreview> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageEmailPreview() {
}
public PageEmailPreview content(List<EmailPreview> content) {
this.content = content;
return this;
}
public PageEmailPreview addContentItem(EmailPreview contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<EmailPreview> getContent() {
return content;
}
public void setContent(List<EmailPreview> content) {
this.content = content;
}
public PageEmailPreview pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageEmailPreview total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageEmailPreview totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageEmailPreview totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageEmailPreview last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageEmailPreview size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageEmailPreview number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageEmailPreview sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageEmailPreview numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageEmailPreview first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageEmailPreview empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageEmailPreview pageEmailPreview = (PageEmailPreview) o;
return Objects.equals(this.content, pageEmailPreview.content) &&
Objects.equals(this.pageable, pageEmailPreview.pageable) &&
Objects.equals(this.total, pageEmailPreview.total) &&
Objects.equals(this.totalElements, pageEmailPreview.totalElements) &&
Objects.equals(this.totalPages, pageEmailPreview.totalPages) &&
Objects.equals(this.last, pageEmailPreview.last) &&
Objects.equals(this.size, pageEmailPreview.size) &&
Objects.equals(this.number, pageEmailPreview.number) &&
Objects.equals(this.sort, pageEmailPreview.sort) &&
Objects.equals(this.numberOfElements, pageEmailPreview.numberOfElements) &&
Objects.equals(this.first, pageEmailPreview.first) &&
Objects.equals(this.empty, pageEmailPreview.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageEmailPreview {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageEmailPreview
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageEmailPreview.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageEmailPreview is not found in the empty JSON string", PageEmailPreview.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageEmailPreview.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageEmailPreview` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
EmailPreview.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageEmailPreview.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageEmailPreview' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageEmailPreview> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageEmailPreview.class));
return (TypeAdapter<T>) new TypeAdapter<PageEmailPreview>() {
@Override
public void write(JsonWriter out, PageEmailPreview value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageEmailPreview read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageEmailPreview given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageEmailPreview
* @throws IOException if the JSON string is invalid with respect to PageEmailPreview
*/
public static PageEmailPreview fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageEmailPreview.class);
}
/**
* Convert an instance of PageEmailPreview to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.DeliveryStatusDto;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated delivery status results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated delivery status results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageDeliveryStatus {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<DeliveryStatusDto> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageDeliveryStatus() {
}
public PageDeliveryStatus content(List<DeliveryStatusDto> content) {
this.content = content;
return this;
}
public PageDeliveryStatus addContentItem(DeliveryStatusDto contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<DeliveryStatusDto> getContent() {
return content;
}
public void setContent(List<DeliveryStatusDto> content) {
this.content = content;
}
public PageDeliveryStatus pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageDeliveryStatus total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageDeliveryStatus totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageDeliveryStatus totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageDeliveryStatus last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageDeliveryStatus size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageDeliveryStatus number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageDeliveryStatus sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageDeliveryStatus numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageDeliveryStatus first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageDeliveryStatus empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageDeliveryStatus pageDeliveryStatus = (PageDeliveryStatus) o;
return Objects.equals(this.content, pageDeliveryStatus.content) &&
Objects.equals(this.pageable, pageDeliveryStatus.pageable) &&
Objects.equals(this.total, pageDeliveryStatus.total) &&
Objects.equals(this.totalElements, pageDeliveryStatus.totalElements) &&
Objects.equals(this.totalPages, pageDeliveryStatus.totalPages) &&
Objects.equals(this.last, pageDeliveryStatus.last) &&
Objects.equals(this.size, pageDeliveryStatus.size) &&
Objects.equals(this.number, pageDeliveryStatus.number) &&
Objects.equals(this.sort, pageDeliveryStatus.sort) &&
Objects.equals(this.numberOfElements, pageDeliveryStatus.numberOfElements) &&
Objects.equals(this.first, pageDeliveryStatus.first) &&
Objects.equals(this.empty, pageDeliveryStatus.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageDeliveryStatus {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageDeliveryStatus
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageDeliveryStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageDeliveryStatus is not found in the empty JSON string", PageDeliveryStatus.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageDeliveryStatus.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageDeliveryStatus` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
DeliveryStatusDto.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageDeliveryStatus.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageDeliveryStatus' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageDeliveryStatus> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageDeliveryStatus.class));
return (TypeAdapter<T>) new TypeAdapter<PageDeliveryStatus>() {
@Override
public void write(JsonWriter out, PageDeliveryStatus value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageDeliveryStatus read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageDeliveryStatus given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageDeliveryStatus
* @throws IOException if the JSON string is invalid with respect to PageDeliveryStatus
*/
public static PageDeliveryStatus fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageDeliveryStatus.class);
}
/**
* Convert an instance of PageDeliveryStatus to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ContactProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated contact results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated contact results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageContactProjection {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ContactProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageContactProjection() {
}
public PageContactProjection content(List<ContactProjection> content) {
this.content = content;
return this;
}
public PageContactProjection addContentItem(ContactProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ContactProjection> getContent() {
return content;
}
public void setContent(List<ContactProjection> content) {
this.content = content;
}
public PageContactProjection pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageContactProjection total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageContactProjection totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageContactProjection totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageContactProjection last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageContactProjection size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageContactProjection number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageContactProjection sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageContactProjection numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageContactProjection first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageContactProjection empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageContactProjection pageContactProjection = (PageContactProjection) o;
return Objects.equals(this.content, pageContactProjection.content) &&
Objects.equals(this.pageable, pageContactProjection.pageable) &&
Objects.equals(this.total, pageContactProjection.total) &&
Objects.equals(this.totalElements, pageContactProjection.totalElements) &&
Objects.equals(this.totalPages, pageContactProjection.totalPages) &&
Objects.equals(this.last, pageContactProjection.last) &&
Objects.equals(this.size, pageContactProjection.size) &&
Objects.equals(this.number, pageContactProjection.number) &&
Objects.equals(this.sort, pageContactProjection.sort) &&
Objects.equals(this.numberOfElements, pageContactProjection.numberOfElements) &&
Objects.equals(this.first, pageContactProjection.first) &&
Objects.equals(this.empty, pageContactProjection.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageContactProjection {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageContactProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageContactProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageContactProjection is not found in the empty JSON string", PageContactProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageContactProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageContactProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ContactProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageContactProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageContactProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageContactProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageContactProjection.class));
return (TypeAdapter<T>) new TypeAdapter<PageContactProjection>() {
@Override
public void write(JsonWriter out, PageContactProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageContactProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageContactProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageContactProjection
* @throws IOException if the JSON string is invalid with respect to PageContactProjection
*/
public static PageContactProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageContactProjection.class);
}
/**
* Convert an instance of PageContactProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConnectorSyncEventProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox connector sync events. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox connector sync events. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageConnectorSyncEvents {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ConnectorSyncEventProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageConnectorSyncEvents() {
}
public PageConnectorSyncEvents content(List<ConnectorSyncEventProjection> content) {
this.content = content;
return this;
}
public PageConnectorSyncEvents addContentItem(ConnectorSyncEventProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorSyncEventProjection> getContent() {
return content;
}
public void setContent(List<ConnectorSyncEventProjection> content) {
this.content = content;
}
public PageConnectorSyncEvents pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageConnectorSyncEvents total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageConnectorSyncEvents totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageConnectorSyncEvents totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageConnectorSyncEvents last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageConnectorSyncEvents size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageConnectorSyncEvents number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageConnectorSyncEvents sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageConnectorSyncEvents numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageConnectorSyncEvents first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageConnectorSyncEvents empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageConnectorSyncEvents pageConnectorSyncEvents = (PageConnectorSyncEvents) o;
return Objects.equals(this.content, pageConnectorSyncEvents.content) &&
Objects.equals(this.pageable, pageConnectorSyncEvents.pageable) &&
Objects.equals(this.total, pageConnectorSyncEvents.total) &&
Objects.equals(this.totalElements, pageConnectorSyncEvents.totalElements) &&
Objects.equals(this.totalPages, pageConnectorSyncEvents.totalPages) &&
Objects.equals(this.last, pageConnectorSyncEvents.last) &&
Objects.equals(this.size, pageConnectorSyncEvents.size) &&
Objects.equals(this.number, pageConnectorSyncEvents.number) &&
Objects.equals(this.sort, pageConnectorSyncEvents.sort) &&
Objects.equals(this.numberOfElements, pageConnectorSyncEvents.numberOfElements) &&
Objects.equals(this.first, pageConnectorSyncEvents.first) &&
Objects.equals(this.empty, pageConnectorSyncEvents.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageConnectorSyncEvents {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageConnectorSyncEvents
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageConnectorSyncEvents.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageConnectorSyncEvents is not found in the empty JSON string", PageConnectorSyncEvents.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageConnectorSyncEvents.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageConnectorSyncEvents` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ConnectorSyncEventProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageConnectorSyncEvents.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageConnectorSyncEvents' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageConnectorSyncEvents> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageConnectorSyncEvents.class));
return (TypeAdapter<T>) new TypeAdapter<PageConnectorSyncEvents>() {
@Override
public void write(JsonWriter out, PageConnectorSyncEvents value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageConnectorSyncEvents read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageConnectorSyncEvents given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageConnectorSyncEvents
* @throws IOException if the JSON string is invalid with respect to PageConnectorSyncEvents
*/
public static PageConnectorSyncEvents fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageConnectorSyncEvents.class);
}
/**
* Convert an instance of PageConnectorSyncEvents to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConnectorProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated inbox connectors. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated inbox connectors. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageConnector {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<ConnectorProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageConnector() {
}
public PageConnector content(List<ConnectorProjection> content) {
this.content = content;
return this;
}
public PageConnector addContentItem(ConnectorProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorProjection> getContent() {
return content;
}
public void setContent(List<ConnectorProjection> content) {
this.content = content;
}
public PageConnector pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageConnector total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageConnector totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageConnector totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageConnector last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageConnector size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageConnector number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageConnector sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageConnector numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageConnector first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageConnector empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageConnector pageConnector = (PageConnector) o;
return Objects.equals(this.content, pageConnector.content) &&
Objects.equals(this.pageable, pageConnector.pageable) &&
Objects.equals(this.total, pageConnector.total) &&
Objects.equals(this.totalElements, pageConnector.totalElements) &&
Objects.equals(this.totalPages, pageConnector.totalPages) &&
Objects.equals(this.last, pageConnector.last) &&
Objects.equals(this.size, pageConnector.size) &&
Objects.equals(this.number, pageConnector.number) &&
Objects.equals(this.sort, pageConnector.sort) &&
Objects.equals(this.numberOfElements, pageConnector.numberOfElements) &&
Objects.equals(this.first, pageConnector.first) &&
Objects.equals(this.empty, pageConnector.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageConnector {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageConnector
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageConnector.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageConnector is not found in the empty JSON string", PageConnector.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageConnector.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageConnector` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
ConnectorProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageConnector.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageConnector' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageConnector> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageConnector.class));
return (TypeAdapter<T>) new TypeAdapter<PageConnector>() {
@Override
public void write(JsonWriter out, PageConnector value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageConnector read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageConnector given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageConnector
* @throws IOException if the JSON string is invalid with respect to PageConnector
*/
public static PageConnector fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageConnector.class);
}
/**
* Convert an instance of PageConnector to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.Complaint;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated complaint email. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated complaint email. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageComplaint {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<Complaint> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageComplaint() {
}
public PageComplaint content(List<Complaint> content) {
this.content = content;
return this;
}
public PageComplaint addContentItem(Complaint contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<Complaint> getContent() {
return content;
}
public void setContent(List<Complaint> content) {
this.content = content;
}
public PageComplaint pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageComplaint total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageComplaint totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageComplaint totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageComplaint last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageComplaint size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageComplaint number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageComplaint sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageComplaint numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageComplaint first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageComplaint empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageComplaint pageComplaint = (PageComplaint) o;
return Objects.equals(this.content, pageComplaint.content) &&
Objects.equals(this.pageable, pageComplaint.pageable) &&
Objects.equals(this.total, pageComplaint.total) &&
Objects.equals(this.totalElements, pageComplaint.totalElements) &&
Objects.equals(this.totalPages, pageComplaint.totalPages) &&
Objects.equals(this.last, pageComplaint.last) &&
Objects.equals(this.size, pageComplaint.size) &&
Objects.equals(this.number, pageComplaint.number) &&
Objects.equals(this.sort, pageComplaint.sort) &&
Objects.equals(this.numberOfElements, pageComplaint.numberOfElements) &&
Objects.equals(this.first, pageComplaint.first) &&
Objects.equals(this.empty, pageComplaint.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageComplaint {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageComplaint
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageComplaint.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageComplaint is not found in the empty JSON string", PageComplaint.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageComplaint.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageComplaint` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
Complaint.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageComplaint.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageComplaint' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageComplaint> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageComplaint.class));
return (TypeAdapter<T>) new TypeAdapter<PageComplaint>() {
@Override
public void write(JsonWriter out, PageComplaint value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageComplaint read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageComplaint given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageComplaint
* @throws IOException if the JSON string is invalid with respect to PageComplaint
*/
public static PageComplaint fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageComplaint.class);
}
/**
* Convert an instance of PageComplaint to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.BounceRecipientProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated bounced recipients. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated bounced recipients. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageBouncedRecipients {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<BounceRecipientProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageBouncedRecipients() {
}
public PageBouncedRecipients content(List<BounceRecipientProjection> content) {
this.content = content;
return this;
}
public PageBouncedRecipients addContentItem(BounceRecipientProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<BounceRecipientProjection> getContent() {
return content;
}
public void setContent(List<BounceRecipientProjection> content) {
this.content = content;
}
public PageBouncedRecipients pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageBouncedRecipients total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageBouncedRecipients totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageBouncedRecipients totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageBouncedRecipients last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageBouncedRecipients size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageBouncedRecipients number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageBouncedRecipients sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageBouncedRecipients numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageBouncedRecipients first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageBouncedRecipients empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageBouncedRecipients pageBouncedRecipients = (PageBouncedRecipients) o;
return Objects.equals(this.content, pageBouncedRecipients.content) &&
Objects.equals(this.pageable, pageBouncedRecipients.pageable) &&
Objects.equals(this.total, pageBouncedRecipients.total) &&
Objects.equals(this.totalElements, pageBouncedRecipients.totalElements) &&
Objects.equals(this.totalPages, pageBouncedRecipients.totalPages) &&
Objects.equals(this.last, pageBouncedRecipients.last) &&
Objects.equals(this.size, pageBouncedRecipients.size) &&
Objects.equals(this.number, pageBouncedRecipients.number) &&
Objects.equals(this.sort, pageBouncedRecipients.sort) &&
Objects.equals(this.numberOfElements, pageBouncedRecipients.numberOfElements) &&
Objects.equals(this.first, pageBouncedRecipients.first) &&
Objects.equals(this.empty, pageBouncedRecipients.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageBouncedRecipients {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageBouncedRecipients
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageBouncedRecipients.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageBouncedRecipients is not found in the empty JSON string", PageBouncedRecipients.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageBouncedRecipients.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageBouncedRecipients` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
BounceRecipientProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageBouncedRecipients.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageBouncedRecipients' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageBouncedRecipients> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageBouncedRecipients.class));
return (TypeAdapter<T>) new TypeAdapter<PageBouncedRecipients>() {
@Override
public void write(JsonWriter out, PageBouncedRecipients value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageBouncedRecipients read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageBouncedRecipients given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageBouncedRecipients
* @throws IOException if the JSON string is invalid with respect to PageBouncedRecipients
*/
public static PageBouncedRecipients fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageBouncedRecipients.class);
}
/**
* Convert an instance of PageBouncedRecipients to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.BounceProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated bounced email. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated bounced email. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageBouncedEmail {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<BounceProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageBouncedEmail() {
}
public PageBouncedEmail content(List<BounceProjection> content) {
this.content = content;
return this;
}
public PageBouncedEmail addContentItem(BounceProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<BounceProjection> getContent() {
return content;
}
public void setContent(List<BounceProjection> content) {
this.content = content;
}
public PageBouncedEmail pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageBouncedEmail total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageBouncedEmail totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageBouncedEmail totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageBouncedEmail last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageBouncedEmail size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageBouncedEmail number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageBouncedEmail sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageBouncedEmail numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageBouncedEmail first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageBouncedEmail empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageBouncedEmail pageBouncedEmail = (PageBouncedEmail) o;
return Objects.equals(this.content, pageBouncedEmail.content) &&
Objects.equals(this.pageable, pageBouncedEmail.pageable) &&
Objects.equals(this.total, pageBouncedEmail.total) &&
Objects.equals(this.totalElements, pageBouncedEmail.totalElements) &&
Objects.equals(this.totalPages, pageBouncedEmail.totalPages) &&
Objects.equals(this.last, pageBouncedEmail.last) &&
Objects.equals(this.size, pageBouncedEmail.size) &&
Objects.equals(this.number, pageBouncedEmail.number) &&
Objects.equals(this.sort, pageBouncedEmail.sort) &&
Objects.equals(this.numberOfElements, pageBouncedEmail.numberOfElements) &&
Objects.equals(this.first, pageBouncedEmail.first) &&
Objects.equals(this.empty, pageBouncedEmail.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageBouncedEmail {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageBouncedEmail
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageBouncedEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageBouncedEmail is not found in the empty JSON string", PageBouncedEmail.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageBouncedEmail.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageBouncedEmail` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
BounceProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageBouncedEmail.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageBouncedEmail' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageBouncedEmail> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageBouncedEmail.class));
return (TypeAdapter<T>) new TypeAdapter<PageBouncedEmail>() {
@Override
public void write(JsonWriter out, PageBouncedEmail value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageBouncedEmail read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageBouncedEmail given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageBouncedEmail
* @throws IOException if the JSON string is invalid with respect to PageBouncedEmail
*/
public static PageBouncedEmail fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageBouncedEmail.class);
}
/**
* Convert an instance of PageBouncedEmail to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.AttachmentProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated attachment entity results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated attachment entity results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageAttachmentEntity {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<AttachmentProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageAttachmentEntity() {
}
public PageAttachmentEntity content(List<AttachmentProjection> content) {
this.content = content;
return this;
}
public PageAttachmentEntity addContentItem(AttachmentProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<AttachmentProjection> getContent() {
return content;
}
public void setContent(List<AttachmentProjection> content) {
this.content = content;
}
public PageAttachmentEntity pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageAttachmentEntity total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageAttachmentEntity totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageAttachmentEntity totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageAttachmentEntity last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageAttachmentEntity size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageAttachmentEntity number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageAttachmentEntity sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageAttachmentEntity numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageAttachmentEntity first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageAttachmentEntity empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageAttachmentEntity pageAttachmentEntity = (PageAttachmentEntity) o;
return Objects.equals(this.content, pageAttachmentEntity.content) &&
Objects.equals(this.pageable, pageAttachmentEntity.pageable) &&
Objects.equals(this.total, pageAttachmentEntity.total) &&
Objects.equals(this.totalElements, pageAttachmentEntity.totalElements) &&
Objects.equals(this.totalPages, pageAttachmentEntity.totalPages) &&
Objects.equals(this.last, pageAttachmentEntity.last) &&
Objects.equals(this.size, pageAttachmentEntity.size) &&
Objects.equals(this.number, pageAttachmentEntity.number) &&
Objects.equals(this.sort, pageAttachmentEntity.sort) &&
Objects.equals(this.numberOfElements, pageAttachmentEntity.numberOfElements) &&
Objects.equals(this.first, pageAttachmentEntity.first) &&
Objects.equals(this.empty, pageAttachmentEntity.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageAttachmentEntity {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageAttachmentEntity
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageAttachmentEntity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageAttachmentEntity is not found in the empty JSON string", PageAttachmentEntity.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageAttachmentEntity.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageAttachmentEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
AttachmentProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageAttachmentEntity.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageAttachmentEntity' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageAttachmentEntity> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageAttachmentEntity.class));
return (TypeAdapter<T>) new TypeAdapter<PageAttachmentEntity>() {
@Override
public void write(JsonWriter out, PageAttachmentEntity value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageAttachmentEntity read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageAttachmentEntity given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageAttachmentEntity
* @throws IOException if the JSON string is invalid with respect to PageAttachmentEntity
*/
public static PageAttachmentEntity fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageAttachmentEntity.class);
}
/**
* Convert an instance of PageAttachmentEntity to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.AliasProjection;
import com.mailslurp.models.PageableObject;
import com.mailslurp.models.Sort;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Paginated email alias results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.
*/
@ApiModel(description = "Paginated email alias results. Page index starts at zero. Projection results may omit larger entity fields. For fetching a full entity use the projection ID with individual method calls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class PageAlias {
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private List<AliasProjection> content = null;
public static final String SERIALIZED_NAME_PAGEABLE = "pageable";
@SerializedName(SERIALIZED_NAME_PAGEABLE)
private PageableObject pageable;
public static final String SERIALIZED_NAME_TOTAL = "total";
@SerializedName(SERIALIZED_NAME_TOTAL)
private Long total;
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages";
@SerializedName(SERIALIZED_NAME_TOTAL_PAGES)
private Integer totalPages;
public static final String SERIALIZED_NAME_LAST = "last";
@SerializedName(SERIALIZED_NAME_LAST)
private Boolean last;
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private Integer size;
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)
private Integer number;
public static final String SERIALIZED_NAME_SORT = "sort";
@SerializedName(SERIALIZED_NAME_SORT)
private Sort sort;
public static final String SERIALIZED_NAME_NUMBER_OF_ELEMENTS = "numberOfElements";
@SerializedName(SERIALIZED_NAME_NUMBER_OF_ELEMENTS)
private Integer numberOfElements;
public static final String SERIALIZED_NAME_FIRST = "first";
@SerializedName(SERIALIZED_NAME_FIRST)
private Boolean first;
public static final String SERIALIZED_NAME_EMPTY = "empty";
@SerializedName(SERIALIZED_NAME_EMPTY)
private Boolean empty;
public PageAlias() {
}
public PageAlias content(List<AliasProjection> content) {
this.content = content;
return this;
}
public PageAlias addContentItem(AliasProjection contentItem) {
if (this.content == null) {
this.content = new ArrayList<>();
}
this.content.add(contentItem);
return this;
}
/**
* Get content
* @return content
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<AliasProjection> getContent() {
return content;
}
public void setContent(List<AliasProjection> content) {
this.content = content;
}
public PageAlias pageable(PageableObject pageable) {
this.pageable = pageable;
return this;
}
/**
* Get pageable
* @return pageable
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public PageableObject getPageable() {
return pageable;
}
public void setPageable(PageableObject pageable) {
this.pageable = pageable;
}
public PageAlias total(Long total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public PageAlias totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
public PageAlias totalPages(Integer totalPages) {
this.totalPages = totalPages;
return this;
}
/**
* Get totalPages
* @return totalPages
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public PageAlias last(Boolean last) {
this.last = last;
return this;
}
/**
* Get last
* @return last
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getLast() {
return last;
}
public void setLast(Boolean last) {
this.last = last;
}
public PageAlias size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PageAlias number(Integer number) {
this.number = number;
return this;
}
/**
* Get number
* @return number
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public PageAlias sort(Sort sort) {
this.sort = sort;
return this;
}
/**
* Get sort
* @return sort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public PageAlias numberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
return this;
}
/**
* Get numberOfElements
* @return numberOfElements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public PageAlias first(Boolean first) {
this.first = first;
return this;
}
/**
* Get first
* @return first
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getFirst() {
return first;
}
public void setFirst(Boolean first) {
this.first = first;
}
public PageAlias empty(Boolean empty) {
this.empty = empty;
return this;
}
/**
* Get empty
* @return empty
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getEmpty() {
return empty;
}
public void setEmpty(Boolean empty) {
this.empty = empty;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PageAlias pageAlias = (PageAlias) o;
return Objects.equals(this.content, pageAlias.content) &&
Objects.equals(this.pageable, pageAlias.pageable) &&
Objects.equals(this.total, pageAlias.total) &&
Objects.equals(this.totalElements, pageAlias.totalElements) &&
Objects.equals(this.totalPages, pageAlias.totalPages) &&
Objects.equals(this.last, pageAlias.last) &&
Objects.equals(this.size, pageAlias.size) &&
Objects.equals(this.number, pageAlias.number) &&
Objects.equals(this.sort, pageAlias.sort) &&
Objects.equals(this.numberOfElements, pageAlias.numberOfElements) &&
Objects.equals(this.first, pageAlias.first) &&
Objects.equals(this.empty, pageAlias.empty);
}
@Override
public int hashCode() {
return Objects.hash(content, pageable, total, totalElements, totalPages, last, size, number, sort, numberOfElements, first, empty);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PageAlias {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" pageable: ").append(toIndentedString(pageable)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n");
sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n");
sb.append(" last: ").append(toIndentedString(last)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" sort: ").append(toIndentedString(sort)).append("\n");
sb.append(" numberOfElements: ").append(toIndentedString(numberOfElements)).append("\n");
sb.append(" first: ").append(toIndentedString(first)).append("\n");
sb.append(" empty: ").append(toIndentedString(empty)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("content");
openapiFields.add("pageable");
openapiFields.add("total");
openapiFields.add("totalElements");
openapiFields.add("totalPages");
openapiFields.add("last");
openapiFields.add("size");
openapiFields.add("number");
openapiFields.add("sort");
openapiFields.add("numberOfElements");
openapiFields.add("first");
openapiFields.add("empty");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to PageAlias
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!PageAlias.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PageAlias is not found in the empty JSON string", PageAlias.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!PageAlias.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageAlias` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) {
JsonArray jsonArraycontent = jsonObj.getAsJsonArray("content");
if (jsonArraycontent != null) {
// ensure the json data is an array
if (!jsonObj.get("content").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
// validate the optional field `content` (array)
for (int i = 0; i < jsonArraycontent.size(); i++) {
AliasProjection.validateJsonObject(jsonArraycontent.get(i).getAsJsonObject());
};
}
}
// validate the optional field `pageable`
if (jsonObj.get("pageable") != null && !jsonObj.get("pageable").isJsonNull()) {
PageableObject.validateJsonObject(jsonObj.getAsJsonObject("pageable"));
}
// validate the optional field `sort`
if (jsonObj.get("sort") != null && !jsonObj.get("sort").isJsonNull()) {
Sort.validateJsonObject(jsonObj.getAsJsonObject("sort"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PageAlias.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PageAlias' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PageAlias> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PageAlias.class));
return (TypeAdapter<T>) new TypeAdapter<PageAlias>() {
@Override
public void write(JsonWriter out, PageAlias value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PageAlias read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of PageAlias given an JSON string
*
* @param jsonString JSON string
* @return An instance of PageAlias
* @throws IOException if the JSON string is invalid with respect to PageAlias
*/
public static PageAlias fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PageAlias.class);
}
/**
* Convert an instance of PageAlias to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Organization team inbox
*/
@ApiModel(description = "Organization team inbox")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class OrganizationInboxProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_FAVOURITE = "favourite";
@SerializedName(SERIALIZED_NAME_FAVOURITE)
private Boolean favourite;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
public static final String SERIALIZED_NAME_TEAM_ACCESS = "teamAccess";
@SerializedName(SERIALIZED_NAME_TEAM_ACCESS)
private Boolean teamAccess;
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
*/
@JsonAdapter(InboxTypeEnum.Adapter.class)
public enum InboxTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_INBOX("SMTP_INBOX");
private String value;
InboxTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static InboxTypeEnum fromValue(String value) {
for (InboxTypeEnum b : InboxTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<InboxTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final InboxTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public InboxTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return InboxTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_INBOX_TYPE = "inboxType";
@SerializedName(SERIALIZED_NAME_INBOX_TYPE)
private InboxTypeEnum inboxType;
public static final String SERIALIZED_NAME_READ_ONLY = "readOnly";
@SerializedName(SERIALIZED_NAME_READ_ONLY)
private Boolean readOnly;
public static final String SERIALIZED_NAME_VIRTUAL_INBOX = "virtualInbox";
@SerializedName(SERIALIZED_NAME_VIRTUAL_INBOX)
private Boolean virtualInbox;
public OrganizationInboxProjection() {
}
public OrganizationInboxProjection id(UUID id) {
this.id = id;
return this;
}
/**
* ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public OrganizationInboxProjection domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* ID of custom domain used by the inbox if any
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of custom domain used by the inbox if any")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public OrganizationInboxProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public OrganizationInboxProjection name(String name) {
this.name = name;
return this;
}
/**
* Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public OrganizationInboxProjection emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
* @return emailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public OrganizationInboxProjection favourite(Boolean favourite) {
this.favourite = favourite;
return this;
}
/**
* Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering
* @return favourite
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering")
public Boolean getFavourite() {
return favourite;
}
public void setFavourite(Boolean favourite) {
this.favourite = favourite;
}
public OrganizationInboxProjection tags(List<String> tags) {
this.tags = tags;
return this;
}
public OrganizationInboxProjection addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public OrganizationInboxProjection teamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
return this;
}
/**
* Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/
* @return teamAccess
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/")
public Boolean getTeamAccess() {
return teamAccess;
}
public void setTeamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
}
public OrganizationInboxProjection inboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
return this;
}
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
* @return inboxType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).")
public InboxTypeEnum getInboxType() {
return inboxType;
}
public void setInboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
}
public OrganizationInboxProjection readOnly(Boolean readOnly) {
this.readOnly = readOnly;
return this;
}
/**
* Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes.
* @return readOnly
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes.")
public Boolean getReadOnly() {
return readOnly;
}
public void setReadOnly(Boolean readOnly) {
this.readOnly = readOnly;
}
public OrganizationInboxProjection virtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
return this;
}
/**
* Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.
* @return virtualInbox
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.")
public Boolean getVirtualInbox() {
return virtualInbox;
}
public void setVirtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrganizationInboxProjection organizationInboxProjection = (OrganizationInboxProjection) o;
return Objects.equals(this.id, organizationInboxProjection.id) &&
Objects.equals(this.domainId, organizationInboxProjection.domainId) &&
Objects.equals(this.createdAt, organizationInboxProjection.createdAt) &&
Objects.equals(this.name, organizationInboxProjection.name) &&
Objects.equals(this.emailAddress, organizationInboxProjection.emailAddress) &&
Objects.equals(this.favourite, organizationInboxProjection.favourite) &&
Objects.equals(this.tags, organizationInboxProjection.tags) &&
Objects.equals(this.teamAccess, organizationInboxProjection.teamAccess) &&
Objects.equals(this.inboxType, organizationInboxProjection.inboxType) &&
Objects.equals(this.readOnly, organizationInboxProjection.readOnly) &&
Objects.equals(this.virtualInbox, organizationInboxProjection.virtualInbox);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, domainId, createdAt, name, emailAddress, favourite, tags, teamAccess, inboxType, readOnly, virtualInbox);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrganizationInboxProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" favourite: ").append(toIndentedString(favourite)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" teamAccess: ").append(toIndentedString(teamAccess)).append("\n");
sb.append(" inboxType: ").append(toIndentedString(inboxType)).append("\n");
sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n");
sb.append(" virtualInbox: ").append(toIndentedString(virtualInbox)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("domainId");
openapiFields.add("createdAt");
openapiFields.add("name");
openapiFields.add("emailAddress");
openapiFields.add("favourite");
openapiFields.add("tags");
openapiFields.add("teamAccess");
openapiFields.add("inboxType");
openapiFields.add("readOnly");
openapiFields.add("virtualInbox");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("favourite");
openapiRequiredFields.add("teamAccess");
openapiRequiredFields.add("readOnly");
openapiRequiredFields.add("virtualInbox");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to OrganizationInboxProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!OrganizationInboxProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationInboxProjection is not found in the empty JSON string", OrganizationInboxProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!OrganizationInboxProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationInboxProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : OrganizationInboxProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("emailAddress") != null && !jsonObj.get("emailAddress").isJsonNull()) && !jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
if ((jsonObj.get("inboxType") != null && !jsonObj.get("inboxType").isJsonNull()) && !jsonObj.get("inboxType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!OrganizationInboxProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'OrganizationInboxProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<OrganizationInboxProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(OrganizationInboxProjection.class));
return (TypeAdapter<T>) new TypeAdapter<OrganizationInboxProjection>() {
@Override
public void write(JsonWriter out, OrganizationInboxProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public OrganizationInboxProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of OrganizationInboxProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of OrganizationInboxProjection
* @throws IOException if the JSON string is invalid with respect to OrganizationInboxProjection
*/
public static OrganizationInboxProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, OrganizationInboxProjection.class);
}
/**
* Convert an instance of OrganizationInboxProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Name Server Record
*/
@ApiModel(description = "Name Server Record")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class NameServerRecord {
public static final String SERIALIZED_NAME_RAW = "raw";
@SerializedName(SERIALIZED_NAME_RAW)
private String raw;
public static final String SERIALIZED_NAME_RECORD_TYPE = "recordType";
@SerializedName(SERIALIZED_NAME_RECORD_TYPE)
private String recordType;
public static final String SERIALIZED_NAME_PRIORITY = "priority";
@SerializedName(SERIALIZED_NAME_PRIORITY)
private String priority;
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private String value;
public NameServerRecord() {
}
public NameServerRecord raw(String raw) {
this.raw = raw;
return this;
}
/**
* Get raw
* @return raw
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRaw() {
return raw;
}
public void setRaw(String raw) {
this.raw = raw;
}
public NameServerRecord recordType(String recordType) {
this.recordType = recordType;
return this;
}
/**
* Get recordType
* @return recordType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRecordType() {
return recordType;
}
public void setRecordType(String recordType) {
this.recordType = recordType;
}
public NameServerRecord priority(String priority) {
this.priority = priority;
return this;
}
/**
* Get priority
* @return priority
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPriority() {
return priority;
}
public void setPriority(String priority) {
this.priority = priority;
}
public NameServerRecord value(String value) {
this.value = value;
return this;
}
/**
* Get value
* @return value
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NameServerRecord nameServerRecord = (NameServerRecord) o;
return Objects.equals(this.raw, nameServerRecord.raw) &&
Objects.equals(this.recordType, nameServerRecord.recordType) &&
Objects.equals(this.priority, nameServerRecord.priority) &&
Objects.equals(this.value, nameServerRecord.value);
}
@Override
public int hashCode() {
return Objects.hash(raw, recordType, priority, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NameServerRecord {\n");
sb.append(" raw: ").append(toIndentedString(raw)).append("\n");
sb.append(" recordType: ").append(toIndentedString(recordType)).append("\n");
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("raw");
openapiFields.add("recordType");
openapiFields.add("priority");
openapiFields.add("value");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("raw");
openapiRequiredFields.add("recordType");
openapiRequiredFields.add("priority");
openapiRequiredFields.add("value");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to NameServerRecord
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!NameServerRecord.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in NameServerRecord is not found in the empty JSON string", NameServerRecord.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!NameServerRecord.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NameServerRecord` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : NameServerRecord.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("raw").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `raw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("raw").toString()));
}
if (!jsonObj.get("recordType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recordType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recordType").toString()));
}
if (!jsonObj.get("priority").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `priority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priority").toString()));
}
if (!jsonObj.get("value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!NameServerRecord.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'NameServerRecord' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<NameServerRecord> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(NameServerRecord.class));
return (TypeAdapter<T>) new TypeAdapter<NameServerRecord>() {
@Override
public void write(JsonWriter out, NameServerRecord value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public NameServerRecord read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of NameServerRecord given an JSON string
*
* @param jsonString JSON string
* @return An instance of NameServerRecord
* @throws IOException if the JSON string is invalid with respect to NameServerRecord
*/
public static NameServerRecord fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, NameServerRecord.class);
}
/**
* Convert an instance of NameServerRecord to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Missed email data
*/
@ApiModel(description = "Missed email data")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class MissedEmailProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public MissedEmailProjection() {
}
public MissedEmailProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public MissedEmailProjection from(String from) {
this.from = from;
return this;
}
/**
* Get from
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public MissedEmailProjection subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public MissedEmailProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public MissedEmailProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MissedEmailProjection missedEmailProjection = (MissedEmailProjection) o;
return Objects.equals(this.id, missedEmailProjection.id) &&
Objects.equals(this.from, missedEmailProjection.from) &&
Objects.equals(this.subject, missedEmailProjection.subject) &&
Objects.equals(this.userId, missedEmailProjection.userId) &&
Objects.equals(this.createdAt, missedEmailProjection.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, from, subject, userId, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MissedEmailProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("from");
openapiFields.add("subject");
openapiFields.add("userId");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to MissedEmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!MissedEmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in MissedEmailProjection is not found in the empty JSON string", MissedEmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!MissedEmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MissedEmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : MissedEmailProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!MissedEmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'MissedEmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<MissedEmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(MissedEmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<MissedEmailProjection>() {
@Override
public void write(JsonWriter out, MissedEmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public MissedEmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of MissedEmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of MissedEmailProjection
* @throws IOException if the JSON string is invalid with respect to MissedEmailProjection
*/
public static MissedEmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, MissedEmailProjection.class);
}
/**
* Convert an instance of MissedEmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Missed email
*/
@ApiModel(description = "Missed email")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class MissedEmailDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_BODY_EXCERPT = "bodyExcerpt";
@SerializedName(SERIALIZED_NAME_BODY_EXCERPT)
private String bodyExcerpt;
public static final String SERIALIZED_NAME_ATTACHMENT_COUNT = "attachmentCount";
@SerializedName(SERIALIZED_NAME_ATTACHMENT_COUNT)
private Integer attachmentCount;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_RAW_URL = "rawUrl";
@SerializedName(SERIALIZED_NAME_RAW_URL)
private String rawUrl;
public static final String SERIALIZED_NAME_RAW_KEY = "rawKey";
@SerializedName(SERIALIZED_NAME_RAW_KEY)
private String rawKey;
public static final String SERIALIZED_NAME_RAW_BUCKET = "rawBucket";
@SerializedName(SERIALIZED_NAME_RAW_BUCKET)
private String rawBucket;
public static final String SERIALIZED_NAME_CAN_RESTORE = "canRestore";
@SerializedName(SERIALIZED_NAME_CAN_RESTORE)
private Boolean canRestore;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = new ArrayList<>();
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = new ArrayList<>();
public static final String SERIALIZED_NAME_INBOX_IDS = "inboxIds";
@SerializedName(SERIALIZED_NAME_INBOX_IDS)
private List<UUID> inboxIds = new ArrayList<>();
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public MissedEmailDto() {
}
public MissedEmailDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public MissedEmailDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public MissedEmailDto subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public MissedEmailDto bodyExcerpt(String bodyExcerpt) {
this.bodyExcerpt = bodyExcerpt;
return this;
}
/**
* Get bodyExcerpt
* @return bodyExcerpt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBodyExcerpt() {
return bodyExcerpt;
}
public void setBodyExcerpt(String bodyExcerpt) {
this.bodyExcerpt = bodyExcerpt;
}
public MissedEmailDto attachmentCount(Integer attachmentCount) {
this.attachmentCount = attachmentCount;
return this;
}
/**
* Get attachmentCount
* @return attachmentCount
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Integer getAttachmentCount() {
return attachmentCount;
}
public void setAttachmentCount(Integer attachmentCount) {
this.attachmentCount = attachmentCount;
}
public MissedEmailDto from(String from) {
this.from = from;
return this;
}
/**
* Get from
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public MissedEmailDto rawUrl(String rawUrl) {
this.rawUrl = rawUrl;
return this;
}
/**
* Get rawUrl
* @return rawUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRawUrl() {
return rawUrl;
}
public void setRawUrl(String rawUrl) {
this.rawUrl = rawUrl;
}
public MissedEmailDto rawKey(String rawKey) {
this.rawKey = rawKey;
return this;
}
/**
* Get rawKey
* @return rawKey
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRawKey() {
return rawKey;
}
public void setRawKey(String rawKey) {
this.rawKey = rawKey;
}
public MissedEmailDto rawBucket(String rawBucket) {
this.rawBucket = rawBucket;
return this;
}
/**
* Get rawBucket
* @return rawBucket
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRawBucket() {
return rawBucket;
}
public void setRawBucket(String rawBucket) {
this.rawBucket = rawBucket;
}
public MissedEmailDto canRestore(Boolean canRestore) {
this.canRestore = canRestore;
return this;
}
/**
* Get canRestore
* @return canRestore
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getCanRestore() {
return canRestore;
}
public void setCanRestore(Boolean canRestore) {
this.canRestore = canRestore;
}
public MissedEmailDto to(List<String> to) {
this.to = to;
return this;
}
public MissedEmailDto addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* Get to
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public MissedEmailDto cc(List<String> cc) {
this.cc = cc;
return this;
}
public MissedEmailDto addCcItem(String ccItem) {
this.cc.add(ccItem);
return this;
}
/**
* Get cc
* @return cc
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public MissedEmailDto bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public MissedEmailDto addBccItem(String bccItem) {
this.bcc.add(bccItem);
return this;
}
/**
* Get bcc
* @return bcc
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public MissedEmailDto inboxIds(List<UUID> inboxIds) {
this.inboxIds = inboxIds;
return this;
}
public MissedEmailDto addInboxIdsItem(UUID inboxIdsItem) {
this.inboxIds.add(inboxIdsItem);
return this;
}
/**
* Get inboxIds
* @return inboxIds
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<UUID> getInboxIds() {
return inboxIds;
}
public void setInboxIds(List<UUID> inboxIds) {
this.inboxIds = inboxIds;
}
public MissedEmailDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public MissedEmailDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MissedEmailDto missedEmailDto = (MissedEmailDto) o;
return Objects.equals(this.id, missedEmailDto.id) &&
Objects.equals(this.userId, missedEmailDto.userId) &&
Objects.equals(this.subject, missedEmailDto.subject) &&
Objects.equals(this.bodyExcerpt, missedEmailDto.bodyExcerpt) &&
Objects.equals(this.attachmentCount, missedEmailDto.attachmentCount) &&
Objects.equals(this.from, missedEmailDto.from) &&
Objects.equals(this.rawUrl, missedEmailDto.rawUrl) &&
Objects.equals(this.rawKey, missedEmailDto.rawKey) &&
Objects.equals(this.rawBucket, missedEmailDto.rawBucket) &&
Objects.equals(this.canRestore, missedEmailDto.canRestore) &&
Objects.equals(this.to, missedEmailDto.to) &&
Objects.equals(this.cc, missedEmailDto.cc) &&
Objects.equals(this.bcc, missedEmailDto.bcc) &&
Objects.equals(this.inboxIds, missedEmailDto.inboxIds) &&
Objects.equals(this.createdAt, missedEmailDto.createdAt) &&
Objects.equals(this.updatedAt, missedEmailDto.updatedAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, subject, bodyExcerpt, attachmentCount, from, rawUrl, rawKey, rawBucket, canRestore, to, cc, bcc, inboxIds, createdAt, updatedAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MissedEmailDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" bodyExcerpt: ").append(toIndentedString(bodyExcerpt)).append("\n");
sb.append(" attachmentCount: ").append(toIndentedString(attachmentCount)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" rawUrl: ").append(toIndentedString(rawUrl)).append("\n");
sb.append(" rawKey: ").append(toIndentedString(rawKey)).append("\n");
sb.append(" rawBucket: ").append(toIndentedString(rawBucket)).append("\n");
sb.append(" canRestore: ").append(toIndentedString(canRestore)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" inboxIds: ").append(toIndentedString(inboxIds)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("subject");
openapiFields.add("bodyExcerpt");
openapiFields.add("attachmentCount");
openapiFields.add("from");
openapiFields.add("rawUrl");
openapiFields.add("rawKey");
openapiFields.add("rawBucket");
openapiFields.add("canRestore");
openapiFields.add("to");
openapiFields.add("cc");
openapiFields.add("bcc");
openapiFields.add("inboxIds");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("attachmentCount");
openapiRequiredFields.add("to");
openapiRequiredFields.add("cc");
openapiRequiredFields.add("bcc");
openapiRequiredFields.add("inboxIds");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to MissedEmailDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!MissedEmailDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in MissedEmailDto is not found in the empty JSON string", MissedEmailDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!MissedEmailDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MissedEmailDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : MissedEmailDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("bodyExcerpt") != null && !jsonObj.get("bodyExcerpt").isJsonNull()) && !jsonObj.get("bodyExcerpt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyExcerpt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyExcerpt").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("rawUrl") != null && !jsonObj.get("rawUrl").isJsonNull()) && !jsonObj.get("rawUrl").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `rawUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawUrl").toString()));
}
if ((jsonObj.get("rawKey") != null && !jsonObj.get("rawKey").isJsonNull()) && !jsonObj.get("rawKey").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `rawKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawKey").toString()));
}
if ((jsonObj.get("rawBucket") != null && !jsonObj.get("rawBucket").isJsonNull()) && !jsonObj.get("rawBucket").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `rawBucket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawBucket").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
// ensure the required json array is present
if (jsonObj.get("cc") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the required json array is present
if (jsonObj.get("bcc") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the required json array is present
if (jsonObj.get("inboxIds") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("inboxIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxIds` to be an array in the JSON string but got `%s`", jsonObj.get("inboxIds").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!MissedEmailDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'MissedEmailDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<MissedEmailDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(MissedEmailDto.class));
return (TypeAdapter<T>) new TypeAdapter<MissedEmailDto>() {
@Override
public void write(JsonWriter out, MissedEmailDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public MissedEmailDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of MissedEmailDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of MissedEmailDto
* @throws IOException if the JSON string is invalid with respect to MissedEmailDto
*/
public static MissedEmailDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, MissedEmailDto.class);
}
/**
* Convert an instance of MissedEmailDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConditionOption;
import com.mailslurp.models.MatchOption;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. You can also pass conditions such as `HAS_ATTACHMENT`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.
*/
@ApiModel(description = "Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. You can also pass conditions such as `HAS_ATTACHMENT`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class MatchOptions {
public static final String SERIALIZED_NAME_MATCHES = "matches";
@SerializedName(SERIALIZED_NAME_MATCHES)
private List<MatchOption> matches = null;
public static final String SERIALIZED_NAME_CONDITIONS = "conditions";
@SerializedName(SERIALIZED_NAME_CONDITIONS)
private List<ConditionOption> conditions = null;
public MatchOptions() {
}
public MatchOptions matches(List<MatchOption> matches) {
this.matches = matches;
return this;
}
public MatchOptions addMatchesItem(MatchOption matchesItem) {
if (this.matches == null) {
this.matches = new ArrayList<>();
}
this.matches.add(matchesItem);
return this;
}
/**
* Zero or more match options such as `{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }`. Options are additive so if one does not match the email is excluded from results
* @return matches
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Zero or more match options such as `{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }`. Options are additive so if one does not match the email is excluded from results")
public List<MatchOption> getMatches() {
return matches;
}
public void setMatches(List<MatchOption> matches) {
this.matches = matches;
}
public MatchOptions conditions(List<ConditionOption> conditions) {
this.conditions = conditions;
return this;
}
public MatchOptions addConditionsItem(ConditionOption conditionsItem) {
if (this.conditions == null) {
this.conditions = new ArrayList<>();
}
this.conditions.add(conditionsItem);
return this;
}
/**
* Zero or more conditions such as `{ condition: 'HAS_ATTACHMENTS', value: 'TRUE' }`. Note the values are the strings `TRUE|FALSE` not booleans.
* @return conditions
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Zero or more conditions such as `{ condition: 'HAS_ATTACHMENTS', value: 'TRUE' }`. Note the values are the strings `TRUE|FALSE` not booleans.")
public List<ConditionOption> getConditions() {
return conditions;
}
public void setConditions(List<ConditionOption> conditions) {
this.conditions = conditions;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MatchOptions matchOptions = (MatchOptions) o;
return Objects.equals(this.matches, matchOptions.matches) &&
Objects.equals(this.conditions, matchOptions.conditions);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(matches, conditions);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MatchOptions {\n");
sb.append(" matches: ").append(toIndentedString(matches)).append("\n");
sb.append(" conditions: ").append(toIndentedString(conditions)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("matches");
openapiFields.add("conditions");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to MatchOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!MatchOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in MatchOptions is not found in the empty JSON string", MatchOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!MatchOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MatchOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("matches") != null && !jsonObj.get("matches").isJsonNull()) {
JsonArray jsonArraymatches = jsonObj.getAsJsonArray("matches");
if (jsonArraymatches != null) {
// ensure the json data is an array
if (!jsonObj.get("matches").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `matches` to be an array in the JSON string but got `%s`", jsonObj.get("matches").toString()));
}
// validate the optional field `matches` (array)
for (int i = 0; i < jsonArraymatches.size(); i++) {
MatchOption.validateJsonObject(jsonArraymatches.get(i).getAsJsonObject());
};
}
}
if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) {
JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions");
if (jsonArrayconditions != null) {
// ensure the json data is an array
if (!jsonObj.get("conditions").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString()));
}
// validate the optional field `conditions` (array)
for (int i = 0; i < jsonArrayconditions.size(); i++) {
ConditionOption.validateJsonObject(jsonArrayconditions.get(i).getAsJsonObject());
};
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!MatchOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'MatchOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<MatchOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(MatchOptions.class));
return (TypeAdapter<T>) new TypeAdapter<MatchOptions>() {
@Override
public void write(JsonWriter out, MatchOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public MatchOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of MatchOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of MatchOptions
* @throws IOException if the JSON string is invalid with respect to MatchOptions
*/
public static MatchOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, MatchOptions.class);
}
/**
* Convert an instance of MatchOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for matching emails in an inbox. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `SUBJECT` should `CONTAIN` value.
*/
@ApiModel(description = "Options for matching emails in an inbox. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `SUBJECT` should `CONTAIN` value.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class MatchOption {
/**
* Fields of an email object that can be used to filter results
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
SUBJECT("SUBJECT"),
TO("TO"),
BCC("BCC"),
CC("CC"),
FROM("FROM");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
/**
* How the value of the email field specified should be compared to the value given in the match options.
*/
@JsonAdapter(ShouldEnum.Adapter.class)
public enum ShouldEnum {
CONTAIN("CONTAIN"),
EQUAL("EQUAL");
private String value;
ShouldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ShouldEnum fromValue(String value) {
for (ShouldEnum b : ShouldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ShouldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ShouldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ShouldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ShouldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SHOULD = "should";
@SerializedName(SERIALIZED_NAME_SHOULD)
private ShouldEnum should;
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private String value;
public MatchOption() {
}
public MatchOption field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Fields of an email object that can be used to filter results
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Fields of an email object that can be used to filter results")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public MatchOption should(ShouldEnum should) {
this.should = should;
return this;
}
/**
* How the value of the email field specified should be compared to the value given in the match options.
* @return should
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "How the value of the email field specified should be compared to the value given in the match options.")
public ShouldEnum getShould() {
return should;
}
public void setShould(ShouldEnum should) {
this.should = should;
}
public MatchOption value(String value) {
this.value = value;
return this;
}
/**
* The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.
* @return value
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.")
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MatchOption matchOption = (MatchOption) o;
return Objects.equals(this.field, matchOption.field) &&
Objects.equals(this.should, matchOption.should) &&
Objects.equals(this.value, matchOption.value);
}
@Override
public int hashCode() {
return Objects.hash(field, should, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MatchOption {\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" should: ").append(toIndentedString(should)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("field");
openapiFields.add("should");
openapiFields.add("value");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("field");
openapiRequiredFields.add("should");
openapiRequiredFields.add("value");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to MatchOption
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!MatchOption.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in MatchOption is not found in the empty JSON string", MatchOption.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!MatchOption.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MatchOption` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : MatchOption.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("should").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `should` to be a primitive type in the JSON string but got `%s`", jsonObj.get("should").toString()));
}
if (!jsonObj.get("value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!MatchOption.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'MatchOption' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<MatchOption> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(MatchOption.class));
return (TypeAdapter<T>) new TypeAdapter<MatchOption>() {
@Override
public void write(JsonWriter out, MatchOption value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public MatchOption read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of MatchOption given an JSON string
*
* @param jsonString JSON string
* @return An instance of MatchOption
* @throws IOException if the JSON string is invalid with respect to MatchOption
*/
public static MatchOption fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, MatchOption.class);
}
/**
* Convert an instance of MatchOption to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* List unsubscribe recipient
*/
@ApiModel(description = "List unsubscribe recipient")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ListUnsubscribeRecipientProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public ListUnsubscribeRecipientProjection() {
}
public ListUnsubscribeRecipientProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ListUnsubscribeRecipientProjection emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public ListUnsubscribeRecipientProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ListUnsubscribeRecipientProjection domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* Get domainId
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ListUnsubscribeRecipientProjection listUnsubscribeRecipientProjection = (ListUnsubscribeRecipientProjection) o;
return Objects.equals(this.id, listUnsubscribeRecipientProjection.id) &&
Objects.equals(this.emailAddress, listUnsubscribeRecipientProjection.emailAddress) &&
Objects.equals(this.createdAt, listUnsubscribeRecipientProjection.createdAt) &&
Objects.equals(this.domainId, listUnsubscribeRecipientProjection.domainId);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, emailAddress, createdAt, domainId);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListUnsubscribeRecipientProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("emailAddress");
openapiFields.add("createdAt");
openapiFields.add("domainId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ListUnsubscribeRecipientProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ListUnsubscribeRecipientProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ListUnsubscribeRecipientProjection is not found in the empty JSON string", ListUnsubscribeRecipientProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ListUnsubscribeRecipientProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListUnsubscribeRecipientProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ListUnsubscribeRecipientProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ListUnsubscribeRecipientProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ListUnsubscribeRecipientProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ListUnsubscribeRecipientProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ListUnsubscribeRecipientProjection.class));
return (TypeAdapter<T>) new TypeAdapter<ListUnsubscribeRecipientProjection>() {
@Override
public void write(JsonWriter out, ListUnsubscribeRecipientProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ListUnsubscribeRecipientProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ListUnsubscribeRecipientProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of ListUnsubscribeRecipientProjection
* @throws IOException if the JSON string is invalid with respect to ListUnsubscribeRecipientProjection
*/
public static ListUnsubscribeRecipientProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ListUnsubscribeRecipientProjection.class);
}
/**
* Convert an instance of ListUnsubscribeRecipientProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* JSONSchema for payload
*/
@ApiModel(description = "JSONSchema for payload")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class JSONSchemaDto {
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private String value;
public JSONSchemaDto() {
}
public JSONSchemaDto value(String value) {
this.value = value;
return this;
}
/**
* Get value
* @return value
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
JSONSchemaDto jsONSchemaDto = (JSONSchemaDto) o;
return Objects.equals(this.value, jsONSchemaDto.value);
}
@Override
public int hashCode() {
return Objects.hash(value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class JSONSchemaDto {\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("value");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("value");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to JSONSchemaDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!JSONSchemaDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in JSONSchemaDto is not found in the empty JSON string", JSONSchemaDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!JSONSchemaDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JSONSchemaDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : JSONSchemaDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!JSONSchemaDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'JSONSchemaDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<JSONSchemaDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(JSONSchemaDto.class));
return (TypeAdapter<T>) new TypeAdapter<JSONSchemaDto>() {
@Override
public void write(JsonWriter out, JSONSchemaDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public JSONSchemaDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of JSONSchemaDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of JSONSchemaDto
* @throws IOException if the JSON string is invalid with respect to JSONSchemaDto
*/
public static JSONSchemaDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, JSONSchemaDto.class);
}
/**
* Convert an instance of JSONSchemaDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of test of inbox ruleset
*/
@ApiModel(description = "Result of test of inbox ruleset")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxRulesetTestResult {
public static final String SERIALIZED_NAME_RULESET_MATCHES = "rulesetMatches";
@SerializedName(SERIALIZED_NAME_RULESET_MATCHES)
private Map<String, Boolean> rulesetMatches = new HashMap<>();
public static final String SERIALIZED_NAME_MATCHES = "matches";
@SerializedName(SERIALIZED_NAME_MATCHES)
private Boolean matches;
public InboxRulesetTestResult() {
}
public InboxRulesetTestResult rulesetMatches(Map<String, Boolean> rulesetMatches) {
this.rulesetMatches = rulesetMatches;
return this;
}
public InboxRulesetTestResult putRulesetMatchesItem(String key, Boolean rulesetMatchesItem) {
this.rulesetMatches.put(key, rulesetMatchesItem);
return this;
}
/**
* Map of inbox ruleset ID to boolean of if target matches
* @return rulesetMatches
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Map of inbox ruleset ID to boolean of if target matches")
public Map<String, Boolean> getRulesetMatches() {
return rulesetMatches;
}
public void setRulesetMatches(Map<String, Boolean> rulesetMatches) {
this.rulesetMatches = rulesetMatches;
}
public InboxRulesetTestResult matches(Boolean matches) {
this.matches = matches;
return this;
}
/**
* Get matches
* @return matches
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getMatches() {
return matches;
}
public void setMatches(Boolean matches) {
this.matches = matches;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxRulesetTestResult inboxRulesetTestResult = (InboxRulesetTestResult) o;
return Objects.equals(this.rulesetMatches, inboxRulesetTestResult.rulesetMatches) &&
Objects.equals(this.matches, inboxRulesetTestResult.matches);
}
@Override
public int hashCode() {
return Objects.hash(rulesetMatches, matches);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxRulesetTestResult {\n");
sb.append(" rulesetMatches: ").append(toIndentedString(rulesetMatches)).append("\n");
sb.append(" matches: ").append(toIndentedString(matches)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("rulesetMatches");
openapiFields.add("matches");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("rulesetMatches");
openapiRequiredFields.add("matches");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxRulesetTestResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxRulesetTestResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxRulesetTestResult is not found in the empty JSON string", InboxRulesetTestResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxRulesetTestResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxRulesetTestResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxRulesetTestResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxRulesetTestResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxRulesetTestResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxRulesetTestResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxRulesetTestResult.class));
return (TypeAdapter<T>) new TypeAdapter<InboxRulesetTestResult>() {
@Override
public void write(JsonWriter out, InboxRulesetTestResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxRulesetTestResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxRulesetTestResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxRulesetTestResult
* @throws IOException if the JSON string is invalid with respect to InboxRulesetTestResult
*/
public static InboxRulesetTestResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxRulesetTestResult.class);
}
/**
* Convert an instance of InboxRulesetTestResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Test options for inbox ruleset
*/
@ApiModel(description = "Test options for inbox ruleset")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxRulesetTestOptions {
public static final String SERIALIZED_NAME_TEST_TARGET = "testTarget";
@SerializedName(SERIALIZED_NAME_TEST_TARGET)
private String testTarget;
public InboxRulesetTestOptions() {
}
public InboxRulesetTestOptions testTarget(String testTarget) {
this.testTarget = testTarget;
return this;
}
/**
* Get testTarget
* @return testTarget
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getTestTarget() {
return testTarget;
}
public void setTestTarget(String testTarget) {
this.testTarget = testTarget;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxRulesetTestOptions inboxRulesetTestOptions = (InboxRulesetTestOptions) o;
return Objects.equals(this.testTarget, inboxRulesetTestOptions.testTarget);
}
@Override
public int hashCode() {
return Objects.hash(testTarget);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxRulesetTestOptions {\n");
sb.append(" testTarget: ").append(toIndentedString(testTarget)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("testTarget");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("testTarget");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxRulesetTestOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxRulesetTestOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxRulesetTestOptions is not found in the empty JSON string", InboxRulesetTestOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxRulesetTestOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxRulesetTestOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxRulesetTestOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("testTarget").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `testTarget` to be a primitive type in the JSON string but got `%s`", jsonObj.get("testTarget").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxRulesetTestOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxRulesetTestOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxRulesetTestOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxRulesetTestOptions.class));
return (TypeAdapter<T>) new TypeAdapter<InboxRulesetTestOptions>() {
@Override
public void write(JsonWriter out, InboxRulesetTestOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxRulesetTestOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxRulesetTestOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxRulesetTestOptions
* @throws IOException if the JSON string is invalid with respect to InboxRulesetTestOptions
*/
public static InboxRulesetTestOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxRulesetTestOptions.class);
}
/**
* Convert an instance of InboxRulesetTestOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Rules for inbox
*/
@ApiModel(description = "Rules for inbox")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxRulesetDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
/**
* Gets or Sets scope
*/
@JsonAdapter(ScopeEnum.Adapter.class)
public enum ScopeEnum {
RECEIVING_EMAILS("RECEIVING_EMAILS"),
SENDING_EMAILS("SENDING_EMAILS");
private String value;
ScopeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ScopeEnum fromValue(String value) {
for (ScopeEnum b : ScopeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ScopeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ScopeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ScopeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ScopeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SCOPE = "scope";
@SerializedName(SERIALIZED_NAME_SCOPE)
private ScopeEnum scope;
/**
* Gets or Sets action
*/
@JsonAdapter(ActionEnum.Adapter.class)
public enum ActionEnum {
BLOCK("BLOCK"),
ALLOW("ALLOW"),
FILTER_REMOVE("FILTER_REMOVE");
private String value;
ActionEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ActionEnum fromValue(String value) {
for (ActionEnum b : ActionEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ActionEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ActionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ActionEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ACTION = "action";
@SerializedName(SERIALIZED_NAME_ACTION)
private ActionEnum action;
public static final String SERIALIZED_NAME_TARGET = "target";
@SerializedName(SERIALIZED_NAME_TARGET)
private String target;
/**
* Gets or Sets handler
*/
@JsonAdapter(HandlerEnum.Adapter.class)
public enum HandlerEnum {
EXCEPTION("EXCEPTION");
private String value;
HandlerEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static HandlerEnum fromValue(String value) {
for (HandlerEnum b : HandlerEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<HandlerEnum> {
@Override
public void write(final JsonWriter jsonWriter, final HandlerEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public HandlerEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return HandlerEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_HANDLER = "handler";
@SerializedName(SERIALIZED_NAME_HANDLER)
private HandlerEnum handler;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public InboxRulesetDto() {
}
public InboxRulesetDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxRulesetDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxRulesetDto scope(ScopeEnum scope) {
this.scope = scope;
return this;
}
/**
* Get scope
* @return scope
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ScopeEnum getScope() {
return scope;
}
public void setScope(ScopeEnum scope) {
this.scope = scope;
}
public InboxRulesetDto action(ActionEnum action) {
this.action = action;
return this;
}
/**
* Get action
* @return action
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ActionEnum getAction() {
return action;
}
public void setAction(ActionEnum action) {
this.action = action;
}
public InboxRulesetDto target(String target) {
this.target = target;
return this;
}
/**
* Get target
* @return target
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public InboxRulesetDto handler(HandlerEnum handler) {
this.handler = handler;
return this;
}
/**
* Get handler
* @return handler
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public HandlerEnum getHandler() {
return handler;
}
public void setHandler(HandlerEnum handler) {
this.handler = handler;
}
public InboxRulesetDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxRulesetDto inboxRulesetDto = (InboxRulesetDto) o;
return Objects.equals(this.id, inboxRulesetDto.id) &&
Objects.equals(this.inboxId, inboxRulesetDto.inboxId) &&
Objects.equals(this.scope, inboxRulesetDto.scope) &&
Objects.equals(this.action, inboxRulesetDto.action) &&
Objects.equals(this.target, inboxRulesetDto.target) &&
Objects.equals(this.handler, inboxRulesetDto.handler) &&
Objects.equals(this.createdAt, inboxRulesetDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, inboxId, scope, action, target, handler, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxRulesetDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
sb.append(" action: ").append(toIndentedString(action)).append("\n");
sb.append(" target: ").append(toIndentedString(target)).append("\n");
sb.append(" handler: ").append(toIndentedString(handler)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("scope");
openapiFields.add("action");
openapiFields.add("target");
openapiFields.add("handler");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("scope");
openapiRequiredFields.add("action");
openapiRequiredFields.add("target");
openapiRequiredFields.add("handler");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxRulesetDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxRulesetDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxRulesetDto is not found in the empty JSON string", InboxRulesetDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxRulesetDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxRulesetDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxRulesetDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("scope").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString()));
}
if (!jsonObj.get("action").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString()));
}
if (!jsonObj.get("target").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `target` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target").toString()));
}
if (!jsonObj.get("handler").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `handler` to be a primitive type in the JSON string but got `%s`", jsonObj.get("handler").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxRulesetDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxRulesetDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxRulesetDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxRulesetDto.class));
return (TypeAdapter<T>) new TypeAdapter<InboxRulesetDto>() {
@Override
public void write(JsonWriter out, InboxRulesetDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxRulesetDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxRulesetDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxRulesetDto
* @throws IOException if the JSON string is invalid with respect to InboxRulesetDto
*/
public static InboxRulesetDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxRulesetDto.class);
}
/**
* Convert an instance of InboxRulesetDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Inbox replier event
*/
@ApiModel(description = "Inbox replier event")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxReplierEventProjection {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
/**
* Gets or Sets status
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
SUCCESS("SUCCESS"),
FAILURE("FAILURE");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<StatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private StatusEnum status;
public static final String SERIALIZED_NAME_RECIPIENTS = "recipients";
@SerializedName(SERIALIZED_NAME_RECIPIENTS)
private List<String> recipients = null;
public static final String SERIALIZED_NAME_EMAIL_ID = "emailId";
@SerializedName(SERIALIZED_NAME_EMAIL_ID)
private UUID emailId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_SENT_ID = "sentId";
@SerializedName(SERIALIZED_NAME_SENT_ID)
private UUID sentId;
public static final String SERIALIZED_NAME_REPLIER_ID = "replierId";
@SerializedName(SERIALIZED_NAME_REPLIER_ID)
private UUID replierId;
public InboxReplierEventProjection() {
}
public InboxReplierEventProjection message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public InboxReplierEventProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxReplierEventProjection status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public InboxReplierEventProjection recipients(List<String> recipients) {
this.recipients = recipients;
return this;
}
public InboxReplierEventProjection addRecipientsItem(String recipientsItem) {
if (this.recipients == null) {
this.recipients = new ArrayList<>();
}
this.recipients.add(recipientsItem);
return this;
}
/**
* Get recipients
* @return recipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getRecipients() {
return recipients;
}
public void setRecipients(List<String> recipients) {
this.recipients = recipients;
}
public InboxReplierEventProjection emailId(UUID emailId) {
this.emailId = emailId;
return this;
}
/**
* Get emailId
* @return emailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getEmailId() {
return emailId;
}
public void setEmailId(UUID emailId) {
this.emailId = emailId;
}
public InboxReplierEventProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxReplierEventProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public InboxReplierEventProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public InboxReplierEventProjection sentId(UUID sentId) {
this.sentId = sentId;
return this;
}
/**
* Get sentId
* @return sentId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentId() {
return sentId;
}
public void setSentId(UUID sentId) {
this.sentId = sentId;
}
public InboxReplierEventProjection replierId(UUID replierId) {
this.replierId = replierId;
return this;
}
/**
* Get replierId
* @return replierId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getReplierId() {
return replierId;
}
public void setReplierId(UUID replierId) {
this.replierId = replierId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxReplierEventProjection inboxReplierEventProjection = (InboxReplierEventProjection) o;
return Objects.equals(this.message, inboxReplierEventProjection.message) &&
Objects.equals(this.id, inboxReplierEventProjection.id) &&
Objects.equals(this.status, inboxReplierEventProjection.status) &&
Objects.equals(this.recipients, inboxReplierEventProjection.recipients) &&
Objects.equals(this.emailId, inboxReplierEventProjection.emailId) &&
Objects.equals(this.inboxId, inboxReplierEventProjection.inboxId) &&
Objects.equals(this.userId, inboxReplierEventProjection.userId) &&
Objects.equals(this.createdAt, inboxReplierEventProjection.createdAt) &&
Objects.equals(this.sentId, inboxReplierEventProjection.sentId) &&
Objects.equals(this.replierId, inboxReplierEventProjection.replierId);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(message, id, status, recipients, emailId, inboxId, userId, createdAt, sentId, replierId);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxReplierEventProjection {\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n");
sb.append(" emailId: ").append(toIndentedString(emailId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" sentId: ").append(toIndentedString(sentId)).append("\n");
sb.append(" replierId: ").append(toIndentedString(replierId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("message");
openapiFields.add("id");
openapiFields.add("status");
openapiFields.add("recipients");
openapiFields.add("emailId");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("sentId");
openapiFields.add("replierId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxReplierEventProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxReplierEventProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxReplierEventProjection is not found in the empty JSON string", InboxReplierEventProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxReplierEventProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxReplierEventProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxReplierEventProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("recipients") != null && !jsonObj.get("recipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `recipients` to be an array in the JSON string but got `%s`", jsonObj.get("recipients").toString()));
}
if ((jsonObj.get("emailId") != null && !jsonObj.get("emailId").isJsonNull()) && !jsonObj.get("emailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailId").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("sentId") != null && !jsonObj.get("sentId").isJsonNull()) && !jsonObj.get("sentId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentId").toString()));
}
if ((jsonObj.get("replierId") != null && !jsonObj.get("replierId").isJsonNull()) && !jsonObj.get("replierId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replierId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replierId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxReplierEventProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxReplierEventProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxReplierEventProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxReplierEventProjection.class));
return (TypeAdapter<T>) new TypeAdapter<InboxReplierEventProjection>() {
@Override
public void write(JsonWriter out, InboxReplierEventProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxReplierEventProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxReplierEventProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxReplierEventProjection
* @throws IOException if the JSON string is invalid with respect to InboxReplierEventProjection
*/
public static InboxReplierEventProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxReplierEventProjection.class);
}
/**
* Convert an instance of InboxReplierEventProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.HashMap;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Inbox replier. Will automatically reply to inbound emails that match given field for an inbox.
*/
@ApiModel(description = "Inbox replier. Will automatically reply to inbound emails that match given field for an inbox.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxReplierDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* Gets or Sets field
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
RECIPIENTS("RECIPIENTS"),
SENDER("SENDER"),
SUBJECT("SUBJECT"),
ATTACHMENTS("ATTACHMENTS");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
public static final String SERIALIZED_NAME_MATCH = "match";
@SerializedName(SERIALIZED_NAME_MATCH)
private String match;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_TEMPLATE_ID = "templateId";
@SerializedName(SERIALIZED_NAME_TEMPLATE_ID)
private UUID templateId;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public static final String SERIALIZED_NAME_IGNORE_REPLY_TO = "ignoreReplyTo";
@SerializedName(SERIALIZED_NAME_IGNORE_REPLY_TO)
private Boolean ignoreReplyTo;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public InboxReplierDto() {
}
public InboxReplierDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxReplierDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxReplierDto name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public InboxReplierDto field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Get field
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public InboxReplierDto match(String match) {
this.match = match;
return this;
}
/**
* Get match
* @return match
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getMatch() {
return match;
}
public void setMatch(String match) {
this.match = match;
}
public InboxReplierDto replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* Get replyTo
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public InboxReplierDto subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public InboxReplierDto from(String from) {
this.from = from;
return this;
}
/**
* Get from
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public InboxReplierDto charset(String charset) {
this.charset = charset;
return this;
}
/**
* Get charset
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public InboxReplierDto isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Get isHTML
* @return isHTML
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public InboxReplierDto templateId(UUID templateId) {
this.templateId = templateId;
return this;
}
/**
* Get templateId
* @return templateId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getTemplateId() {
return templateId;
}
public void setTemplateId(UUID templateId) {
this.templateId = templateId;
}
public InboxReplierDto templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public InboxReplierDto putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Get templateVariables
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
public InboxReplierDto ignoreReplyTo(Boolean ignoreReplyTo) {
this.ignoreReplyTo = ignoreReplyTo;
return this;
}
/**
* Get ignoreReplyTo
* @return ignoreReplyTo
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getIgnoreReplyTo() {
return ignoreReplyTo;
}
public void setIgnoreReplyTo(Boolean ignoreReplyTo) {
this.ignoreReplyTo = ignoreReplyTo;
}
public InboxReplierDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxReplierDto inboxReplierDto = (InboxReplierDto) o;
return Objects.equals(this.id, inboxReplierDto.id) &&
Objects.equals(this.inboxId, inboxReplierDto.inboxId) &&
Objects.equals(this.name, inboxReplierDto.name) &&
Objects.equals(this.field, inboxReplierDto.field) &&
Objects.equals(this.match, inboxReplierDto.match) &&
Objects.equals(this.replyTo, inboxReplierDto.replyTo) &&
Objects.equals(this.subject, inboxReplierDto.subject) &&
Objects.equals(this.from, inboxReplierDto.from) &&
Objects.equals(this.charset, inboxReplierDto.charset) &&
Objects.equals(this.isHTML, inboxReplierDto.isHTML) &&
Objects.equals(this.templateId, inboxReplierDto.templateId) &&
Objects.equals(this.templateVariables, inboxReplierDto.templateVariables) &&
Objects.equals(this.ignoreReplyTo, inboxReplierDto.ignoreReplyTo) &&
Objects.equals(this.createdAt, inboxReplierDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, inboxId, name, field, match, replyTo, subject, from, charset, isHTML, templateId, templateVariables, ignoreReplyTo, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxReplierDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" match: ").append(toIndentedString(match)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n");
sb.append(" ignoreReplyTo: ").append(toIndentedString(ignoreReplyTo)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("name");
openapiFields.add("field");
openapiFields.add("match");
openapiFields.add("replyTo");
openapiFields.add("subject");
openapiFields.add("from");
openapiFields.add("charset");
openapiFields.add("isHTML");
openapiFields.add("templateId");
openapiFields.add("templateVariables");
openapiFields.add("ignoreReplyTo");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("field");
openapiRequiredFields.add("match");
openapiRequiredFields.add("isHTML");
openapiRequiredFields.add("ignoreReplyTo");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxReplierDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxReplierDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxReplierDto is not found in the empty JSON string", InboxReplierDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxReplierDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxReplierDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxReplierDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("match").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `match` to be a primitive type in the JSON string but got `%s`", jsonObj.get("match").toString()));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
if ((jsonObj.get("templateId") != null && !jsonObj.get("templateId").isJsonNull()) && !jsonObj.get("templateId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `templateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxReplierDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxReplierDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxReplierDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxReplierDto.class));
return (TypeAdapter<T>) new TypeAdapter<InboxReplierDto>() {
@Override
public void write(JsonWriter out, InboxReplierDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxReplierDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxReplierDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxReplierDto
* @throws IOException if the JSON string is invalid with respect to InboxReplierDto
*/
public static InboxReplierDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxReplierDto.class);
}
/**
* Convert an instance of InboxReplierDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Inbox data preview element.
*/
@ApiModel(description = "Inbox data preview element.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxPreview {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_FAVOURITE = "favourite";
@SerializedName(SERIALIZED_NAME_FAVOURITE)
private Boolean favourite;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
public static final String SERIALIZED_NAME_TEAM_ACCESS = "teamAccess";
@SerializedName(SERIALIZED_NAME_TEAM_ACCESS)
private Boolean teamAccess;
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
*/
@JsonAdapter(InboxTypeEnum.Adapter.class)
public enum InboxTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_INBOX("SMTP_INBOX");
private String value;
InboxTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static InboxTypeEnum fromValue(String value) {
for (InboxTypeEnum b : InboxTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<InboxTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final InboxTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public InboxTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return InboxTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_INBOX_TYPE = "inboxType";
@SerializedName(SERIALIZED_NAME_INBOX_TYPE)
private InboxTypeEnum inboxType;
public static final String SERIALIZED_NAME_VIRTUAL_INBOX = "virtualInbox";
@SerializedName(SERIALIZED_NAME_VIRTUAL_INBOX)
private Boolean virtualInbox;
public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt";
@SerializedName(SERIALIZED_NAME_EXPIRES_AT)
private String expiresAt;
public InboxPreview() {
}
public InboxPreview id(UUID id) {
this.id = id;
return this;
}
/**
* ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxPreview domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* ID of custom domain used by the inbox if any
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of custom domain used by the inbox if any")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public InboxPreview emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
* @return emailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public InboxPreview createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public InboxPreview favourite(Boolean favourite) {
this.favourite = favourite;
return this;
}
/**
* Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering
* @return favourite
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering")
public Boolean getFavourite() {
return favourite;
}
public void setFavourite(Boolean favourite) {
this.favourite = favourite;
}
public InboxPreview name(String name) {
this.name = name;
return this;
}
/**
* Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public InboxPreview tags(List<String> tags) {
this.tags = tags;
return this;
}
public InboxPreview addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public InboxPreview teamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
return this;
}
/**
* Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/
* @return teamAccess
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Does inbox permit team access for organization team members. If so team users can use inbox and emails associated with it. See the team access guide at https://www.mailslurp.com/guides/team-email-account-sharing/")
public Boolean getTeamAccess() {
return teamAccess;
}
public void setTeamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
}
public InboxPreview inboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
return this;
}
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
* @return inboxType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).")
public InboxTypeEnum getInboxType() {
return inboxType;
}
public void setInboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
}
public InboxPreview virtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
return this;
}
/**
* Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.
* @return virtualInbox
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.")
public Boolean getVirtualInbox() {
return virtualInbox;
}
public void setVirtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
}
public InboxPreview expiresAt(String expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.
* @return expiresAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.")
public String getExpiresAt() {
return expiresAt;
}
public void setExpiresAt(String expiresAt) {
this.expiresAt = expiresAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxPreview inboxPreview = (InboxPreview) o;
return Objects.equals(this.id, inboxPreview.id) &&
Objects.equals(this.domainId, inboxPreview.domainId) &&
Objects.equals(this.emailAddress, inboxPreview.emailAddress) &&
Objects.equals(this.createdAt, inboxPreview.createdAt) &&
Objects.equals(this.favourite, inboxPreview.favourite) &&
Objects.equals(this.name, inboxPreview.name) &&
Objects.equals(this.tags, inboxPreview.tags) &&
Objects.equals(this.teamAccess, inboxPreview.teamAccess) &&
Objects.equals(this.inboxType, inboxPreview.inboxType) &&
Objects.equals(this.virtualInbox, inboxPreview.virtualInbox) &&
Objects.equals(this.expiresAt, inboxPreview.expiresAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, domainId, emailAddress, createdAt, favourite, name, tags, teamAccess, inboxType, virtualInbox, expiresAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxPreview {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" favourite: ").append(toIndentedString(favourite)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" teamAccess: ").append(toIndentedString(teamAccess)).append("\n");
sb.append(" inboxType: ").append(toIndentedString(inboxType)).append("\n");
sb.append(" virtualInbox: ").append(toIndentedString(virtualInbox)).append("\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("domainId");
openapiFields.add("emailAddress");
openapiFields.add("createdAt");
openapiFields.add("favourite");
openapiFields.add("name");
openapiFields.add("tags");
openapiFields.add("teamAccess");
openapiFields.add("inboxType");
openapiFields.add("virtualInbox");
openapiFields.add("expiresAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("favourite");
openapiRequiredFields.add("teamAccess");
openapiRequiredFields.add("virtualInbox");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxPreview
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxPreview.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxPreview is not found in the empty JSON string", InboxPreview.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxPreview.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxPreview` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxPreview.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if ((jsonObj.get("emailAddress") != null && !jsonObj.get("emailAddress").isJsonNull()) && !jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
if ((jsonObj.get("inboxType") != null && !jsonObj.get("inboxType").isJsonNull()) && !jsonObj.get("inboxType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxType").toString()));
}
if ((jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonNull()) && !jsonObj.get("expiresAt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxPreview.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxPreview' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxPreview> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxPreview.class));
return (TypeAdapter<T>) new TypeAdapter<InboxPreview>() {
@Override
public void write(JsonWriter out, InboxPreview value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxPreview read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxPreview given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxPreview
* @throws IOException if the JSON string is invalid with respect to InboxPreview
*/
public static InboxPreview fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxPreview.class);
}
/**
* Convert an instance of InboxPreview to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.InboxIdItem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* List of inbox IDs and email addresses
*/
@ApiModel(description = "List of inbox IDs and email addresses")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxIdsResult {
public static final String SERIALIZED_NAME_INBOX_IDS = "inboxIds";
@SerializedName(SERIALIZED_NAME_INBOX_IDS)
private List<InboxIdItem> inboxIds = new ArrayList<>();
public InboxIdsResult() {
}
public InboxIdsResult inboxIds(List<InboxIdItem> inboxIds) {
this.inboxIds = inboxIds;
return this;
}
public InboxIdsResult addInboxIdsItem(InboxIdItem inboxIdsItem) {
this.inboxIds.add(inboxIdsItem);
return this;
}
/**
* Get inboxIds
* @return inboxIds
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<InboxIdItem> getInboxIds() {
return inboxIds;
}
public void setInboxIds(List<InboxIdItem> inboxIds) {
this.inboxIds = inboxIds;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxIdsResult inboxIdsResult = (InboxIdsResult) o;
return Objects.equals(this.inboxIds, inboxIdsResult.inboxIds);
}
@Override
public int hashCode() {
return Objects.hash(inboxIds);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxIdsResult {\n");
sb.append(" inboxIds: ").append(toIndentedString(inboxIds)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxIds");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxIds");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxIdsResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxIdsResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxIdsResult is not found in the empty JSON string", InboxIdsResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxIdsResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxIdsResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxIdsResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("inboxIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxIds` to be an array in the JSON string but got `%s`", jsonObj.get("inboxIds").toString()));
}
JsonArray jsonArrayinboxIds = jsonObj.getAsJsonArray("inboxIds");
// validate the required field `inboxIds` (array)
for (int i = 0; i < jsonArrayinboxIds.size(); i++) {
InboxIdItem.validateJsonObject(jsonArrayinboxIds.get(i).getAsJsonObject());
};
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxIdsResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxIdsResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxIdsResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxIdsResult.class));
return (TypeAdapter<T>) new TypeAdapter<InboxIdsResult>() {
@Override
public void write(JsonWriter out, InboxIdsResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxIdsResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxIdsResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxIdsResult
* @throws IOException if the JSON string is invalid with respect to InboxIdsResult
*/
public static InboxIdsResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxIdsResult.class);
}
/**
* Convert an instance of InboxIdsResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Inbox ID and email address pair
*/
@ApiModel(description = "Inbox ID and email address pair")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxIdItem {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public InboxIdItem() {
}
public InboxIdItem id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxIdItem emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxIdItem inboxIdItem = (InboxIdItem) o;
return Objects.equals(this.id, inboxIdItem.id) &&
Objects.equals(this.emailAddress, inboxIdItem.emailAddress);
}
@Override
public int hashCode() {
return Objects.hash(id, emailAddress);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxIdItem {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("emailAddress");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("emailAddress");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxIdItem
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxIdItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxIdItem is not found in the empty JSON string", InboxIdItem.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxIdItem.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxIdItem` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxIdItem.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxIdItem.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxIdItem' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxIdItem> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxIdItem.class));
return (TypeAdapter<T>) new TypeAdapter<InboxIdItem>() {
@Override
public void write(JsonWriter out, InboxIdItem value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxIdItem read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxIdItem given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxIdItem
* @throws IOException if the JSON string is invalid with respect to InboxIdItem
*/
public static InboxIdItem fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxIdItem.class);
}
/**
* Convert an instance of InboxIdItem to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Results of inbox forwarder test
*/
@ApiModel(description = "Results of inbox forwarder test")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxForwarderTestResult {
public static final String SERIALIZED_NAME_MATCHES = "matches";
@SerializedName(SERIALIZED_NAME_MATCHES)
private Map<String, Boolean> matches = new HashMap<>();
public static final String SERIALIZED_NAME_DOES_MATCH = "doesMatch";
@SerializedName(SERIALIZED_NAME_DOES_MATCH)
private Boolean doesMatch;
public InboxForwarderTestResult() {
}
public InboxForwarderTestResult matches(Map<String, Boolean> matches) {
this.matches = matches;
return this;
}
public InboxForwarderTestResult putMatchesItem(String key, Boolean matchesItem) {
this.matches.put(key, matchesItem);
return this;
}
/**
* Get matches
* @return matches
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Map<String, Boolean> getMatches() {
return matches;
}
public void setMatches(Map<String, Boolean> matches) {
this.matches = matches;
}
public InboxForwarderTestResult doesMatch(Boolean doesMatch) {
this.doesMatch = doesMatch;
return this;
}
/**
* Get doesMatch
* @return doesMatch
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getDoesMatch() {
return doesMatch;
}
public void setDoesMatch(Boolean doesMatch) {
this.doesMatch = doesMatch;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxForwarderTestResult inboxForwarderTestResult = (InboxForwarderTestResult) o;
return Objects.equals(this.matches, inboxForwarderTestResult.matches) &&
Objects.equals(this.doesMatch, inboxForwarderTestResult.doesMatch);
}
@Override
public int hashCode() {
return Objects.hash(matches, doesMatch);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxForwarderTestResult {\n");
sb.append(" matches: ").append(toIndentedString(matches)).append("\n");
sb.append(" doesMatch: ").append(toIndentedString(doesMatch)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("matches");
openapiFields.add("doesMatch");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("matches");
openapiRequiredFields.add("doesMatch");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxForwarderTestResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxForwarderTestResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxForwarderTestResult is not found in the empty JSON string", InboxForwarderTestResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxForwarderTestResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxForwarderTestResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxForwarderTestResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxForwarderTestResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxForwarderTestResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxForwarderTestResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxForwarderTestResult.class));
return (TypeAdapter<T>) new TypeAdapter<InboxForwarderTestResult>() {
@Override
public void write(JsonWriter out, InboxForwarderTestResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxForwarderTestResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxForwarderTestResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxForwarderTestResult
* @throws IOException if the JSON string is invalid with respect to InboxForwarderTestResult
*/
public static InboxForwarderTestResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxForwarderTestResult.class);
}
/**
* Convert an instance of InboxForwarderTestResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for testing an inbox forwarder against a value
*/
@ApiModel(description = "Options for testing an inbox forwarder against a value")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxForwarderTestOptions {
public static final String SERIALIZED_NAME_TEST_VALUE = "testValue";
@SerializedName(SERIALIZED_NAME_TEST_VALUE)
private String testValue;
public InboxForwarderTestOptions() {
}
public InboxForwarderTestOptions testValue(String testValue) {
this.testValue = testValue;
return this;
}
/**
* Get testValue
* @return testValue
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getTestValue() {
return testValue;
}
public void setTestValue(String testValue) {
this.testValue = testValue;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxForwarderTestOptions inboxForwarderTestOptions = (InboxForwarderTestOptions) o;
return Objects.equals(this.testValue, inboxForwarderTestOptions.testValue);
}
@Override
public int hashCode() {
return Objects.hash(testValue);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxForwarderTestOptions {\n");
sb.append(" testValue: ").append(toIndentedString(testValue)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("testValue");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("testValue");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxForwarderTestOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxForwarderTestOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxForwarderTestOptions is not found in the empty JSON string", InboxForwarderTestOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxForwarderTestOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxForwarderTestOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxForwarderTestOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("testValue").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `testValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("testValue").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxForwarderTestOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxForwarderTestOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxForwarderTestOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxForwarderTestOptions.class));
return (TypeAdapter<T>) new TypeAdapter<InboxForwarderTestOptions>() {
@Override
public void write(JsonWriter out, InboxForwarderTestOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxForwarderTestOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxForwarderTestOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxForwarderTestOptions
* @throws IOException if the JSON string is invalid with respect to InboxForwarderTestOptions
*/
public static InboxForwarderTestOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxForwarderTestOptions.class);
}
/**
* Convert an instance of InboxForwarderTestOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Inbox forwarder event
*/
@ApiModel(description = "Inbox forwarder event")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxForwarderEventProjection {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
/**
* Gets or Sets status
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
SUCCESS("SUCCESS"),
FAILURE("FAILURE");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<StatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private StatusEnum status;
public static final String SERIALIZED_NAME_EMAIL_ID = "emailId";
@SerializedName(SERIALIZED_NAME_EMAIL_ID)
private UUID emailId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_FORWARDER_ID = "forwarderId";
@SerializedName(SERIALIZED_NAME_FORWARDER_ID)
private UUID forwarderId;
public InboxForwarderEventProjection() {
}
public InboxForwarderEventProjection message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public InboxForwarderEventProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxForwarderEventProjection status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public InboxForwarderEventProjection emailId(UUID emailId) {
this.emailId = emailId;
return this;
}
/**
* Get emailId
* @return emailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getEmailId() {
return emailId;
}
public void setEmailId(UUID emailId) {
this.emailId = emailId;
}
public InboxForwarderEventProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxForwarderEventProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public InboxForwarderEventProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public InboxForwarderEventProjection forwarderId(UUID forwarderId) {
this.forwarderId = forwarderId;
return this;
}
/**
* Get forwarderId
* @return forwarderId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getForwarderId() {
return forwarderId;
}
public void setForwarderId(UUID forwarderId) {
this.forwarderId = forwarderId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxForwarderEventProjection inboxForwarderEventProjection = (InboxForwarderEventProjection) o;
return Objects.equals(this.message, inboxForwarderEventProjection.message) &&
Objects.equals(this.id, inboxForwarderEventProjection.id) &&
Objects.equals(this.status, inboxForwarderEventProjection.status) &&
Objects.equals(this.emailId, inboxForwarderEventProjection.emailId) &&
Objects.equals(this.inboxId, inboxForwarderEventProjection.inboxId) &&
Objects.equals(this.userId, inboxForwarderEventProjection.userId) &&
Objects.equals(this.createdAt, inboxForwarderEventProjection.createdAt) &&
Objects.equals(this.forwarderId, inboxForwarderEventProjection.forwarderId);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(message, id, status, emailId, inboxId, userId, createdAt, forwarderId);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxForwarderEventProjection {\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" emailId: ").append(toIndentedString(emailId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" forwarderId: ").append(toIndentedString(forwarderId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("message");
openapiFields.add("id");
openapiFields.add("status");
openapiFields.add("emailId");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("forwarderId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxForwarderEventProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxForwarderEventProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxForwarderEventProjection is not found in the empty JSON string", InboxForwarderEventProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxForwarderEventProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxForwarderEventProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxForwarderEventProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
if ((jsonObj.get("emailId") != null && !jsonObj.get("emailId").isJsonNull()) && !jsonObj.get("emailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailId").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("forwarderId") != null && !jsonObj.get("forwarderId").isJsonNull()) && !jsonObj.get("forwarderId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `forwarderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("forwarderId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxForwarderEventProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxForwarderEventProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxForwarderEventProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxForwarderEventProjection.class));
return (TypeAdapter<T>) new TypeAdapter<InboxForwarderEventProjection>() {
@Override
public void write(JsonWriter out, InboxForwarderEventProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxForwarderEventProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxForwarderEventProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxForwarderEventProjection
* @throws IOException if the JSON string is invalid with respect to InboxForwarderEventProjection
*/
public static InboxForwarderEventProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxForwarderEventProjection.class);
}
/**
* Convert an instance of InboxForwarderEventProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Inbox forwarder. Describes how an inbox will forward matching emails to designated recipients.
*/
@ApiModel(description = "Inbox forwarder. Describes how an inbox will forward matching emails to designated recipients.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxForwarderDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* Which field to match against
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
RECIPIENTS("RECIPIENTS"),
SENDER("SENDER"),
SUBJECT("SUBJECT"),
ATTACHMENTS("ATTACHMENTS");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
public static final String SERIALIZED_NAME_MATCH = "match";
@SerializedName(SERIALIZED_NAME_MATCH)
private String match;
public static final String SERIALIZED_NAME_FORWARD_TO_RECIPIENTS = "forwardToRecipients";
@SerializedName(SERIALIZED_NAME_FORWARD_TO_RECIPIENTS)
private List<String> forwardToRecipients = new ArrayList<>();
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public InboxForwarderDto() {
}
public InboxForwarderDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxForwarderDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxForwarderDto name(String name) {
this.name = name;
return this;
}
/**
* Name of inbox forwarder
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of inbox forwarder")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public InboxForwarderDto field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Which field to match against
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Which field to match against")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public InboxForwarderDto match(String match) {
this.match = match;
return this;
}
/**
* Wild-card type pattern to apply to field
* @return match
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Wild-card type pattern to apply to field")
public String getMatch() {
return match;
}
public void setMatch(String match) {
this.match = match;
}
public InboxForwarderDto forwardToRecipients(List<String> forwardToRecipients) {
this.forwardToRecipients = forwardToRecipients;
return this;
}
public InboxForwarderDto addForwardToRecipientsItem(String forwardToRecipientsItem) {
this.forwardToRecipients.add(forwardToRecipientsItem);
return this;
}
/**
* Who to send forwarded email to
* @return forwardToRecipients
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Who to send forwarded email to")
public List<String> getForwardToRecipients() {
return forwardToRecipients;
}
public void setForwardToRecipients(List<String> forwardToRecipients) {
this.forwardToRecipients = forwardToRecipients;
}
public InboxForwarderDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxForwarderDto inboxForwarderDto = (InboxForwarderDto) o;
return Objects.equals(this.id, inboxForwarderDto.id) &&
Objects.equals(this.inboxId, inboxForwarderDto.inboxId) &&
Objects.equals(this.name, inboxForwarderDto.name) &&
Objects.equals(this.field, inboxForwarderDto.field) &&
Objects.equals(this.match, inboxForwarderDto.match) &&
Objects.equals(this.forwardToRecipients, inboxForwarderDto.forwardToRecipients) &&
Objects.equals(this.createdAt, inboxForwarderDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, inboxId, name, field, match, forwardToRecipients, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxForwarderDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" match: ").append(toIndentedString(match)).append("\n");
sb.append(" forwardToRecipients: ").append(toIndentedString(forwardToRecipients)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("name");
openapiFields.add("field");
openapiFields.add("match");
openapiFields.add("forwardToRecipients");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("field");
openapiRequiredFields.add("match");
openapiRequiredFields.add("forwardToRecipients");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxForwarderDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxForwarderDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxForwarderDto is not found in the empty JSON string", InboxForwarderDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxForwarderDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxForwarderDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxForwarderDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("match").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `match` to be a primitive type in the JSON string but got `%s`", jsonObj.get("match").toString()));
}
// ensure the required json array is present
if (jsonObj.get("forwardToRecipients") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("forwardToRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `forwardToRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("forwardToRecipients").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxForwarderDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxForwarderDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxForwarderDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxForwarderDto.class));
return (TypeAdapter<T>) new TypeAdapter<InboxForwarderDto>() {
@Override
public void write(JsonWriter out, InboxForwarderDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxForwarderDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxForwarderDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxForwarderDto
* @throws IOException if the JSON string is invalid with respect to InboxForwarderDto
*/
public static InboxForwarderDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxForwarderDto.class);
}
/**
* Convert an instance of InboxForwarderDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of email exists query
*/
@ApiModel(description = "Result of email exists query")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxExistsDto {
public static final String SERIALIZED_NAME_EXISTS = "exists";
@SerializedName(SERIALIZED_NAME_EXISTS)
private Boolean exists;
public InboxExistsDto() {
}
public InboxExistsDto exists(Boolean exists) {
this.exists = exists;
return this;
}
/**
* Get exists
* @return exists
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getExists() {
return exists;
}
public void setExists(Boolean exists) {
this.exists = exists;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxExistsDto inboxExistsDto = (InboxExistsDto) o;
return Objects.equals(this.exists, inboxExistsDto.exists);
}
@Override
public int hashCode() {
return Objects.hash(exists);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxExistsDto {\n");
sb.append(" exists: ").append(toIndentedString(exists)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("exists");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("exists");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxExistsDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxExistsDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxExistsDto is not found in the empty JSON string", InboxExistsDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxExistsDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxExistsDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxExistsDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxExistsDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxExistsDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxExistsDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxExistsDto.class));
return (TypeAdapter<T>) new TypeAdapter<InboxExistsDto>() {
@Override
public void write(JsonWriter out, InboxExistsDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxExistsDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxExistsDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxExistsDto
* @throws IOException if the JSON string is invalid with respect to InboxExistsDto
*/
public static InboxExistsDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxExistsDto.class);
}
/**
* Convert an instance of InboxExistsDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Representation of a MailSlurp inbox. An inbox has an ID and a real email address. Emails can be sent to or from this email address. Inboxes are either `SMTP` or `HTTP` mailboxes. The default, `HTTP` inboxes, use AWS SES to process emails and are best suited as test email accounts and do not support IMAP or POP3. `SMTP` inboxes use a custom mail server at `mx.mailslurp.com` and support SMTP login, IMAP and POP3. Use the `EmailController` or the `InboxController` methods to send and receive emails and attachments. Inboxes may have a description, name, and tags for display purposes. You can also favourite an inbox for easier searching.
*/
@ApiModel(description = "Representation of a MailSlurp inbox. An inbox has an ID and a real email address. Emails can be sent to or from this email address. Inboxes are either `SMTP` or `HTTP` mailboxes. The default, `HTTP` inboxes, use AWS SES to process emails and are best suited as test email accounts and do not support IMAP or POP3. `SMTP` inboxes use a custom mail server at `mx.mailslurp.com` and support SMTP login, IMAP and POP3. Use the `EmailController` or the `InboxController` methods to send and receive emails and attachments. Inboxes may have a description, name, and tags for display purposes. You can also favourite an inbox for easier searching.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt";
@SerializedName(SERIALIZED_NAME_EXPIRES_AT)
private String expiresAt;
public static final String SERIALIZED_NAME_FAVOURITE = "favourite";
@SerializedName(SERIALIZED_NAME_FAVOURITE)
private Boolean favourite;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
*/
@JsonAdapter(InboxTypeEnum.Adapter.class)
public enum InboxTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_INBOX("SMTP_INBOX");
private String value;
InboxTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static InboxTypeEnum fromValue(String value) {
for (InboxTypeEnum b : InboxTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<InboxTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final InboxTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public InboxTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return InboxTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_INBOX_TYPE = "inboxType";
@SerializedName(SERIALIZED_NAME_INBOX_TYPE)
private InboxTypeEnum inboxType;
public static final String SERIALIZED_NAME_READ_ONLY = "readOnly";
@SerializedName(SERIALIZED_NAME_READ_ONLY)
private Boolean readOnly;
public static final String SERIALIZED_NAME_VIRTUAL_INBOX = "virtualInbox";
@SerializedName(SERIALIZED_NAME_VIRTUAL_INBOX)
private Boolean virtualInbox;
public InboxDto() {
}
public InboxDto id(UUID id) {
this.id = id;
return this;
}
/**
* ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the inbox. The ID is a UUID-V4 format string. Use the inboxId for calls to Inbox and Email Controller endpoints. See the emailAddress property for the email address or the inbox. To get emails in an inbox use the WaitFor and Inbox Controller methods `waitForLatestEmail` and `getEmails` methods respectively. Inboxes can be used with aliases to forward emails automatically.")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public InboxDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* ID of user that inbox belongs to
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of user that inbox belongs to")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public InboxDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "When the inbox was created. Time stamps are in ISO DateTime Format `yyyy-MM-dd'T'HH:mm:ss.SSSXXX` e.g. `2000-10-31T01:30:00.000-05:00`.")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public InboxDto name(String name) {
this.name = name;
return this;
}
/**
* Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name of the inbox and used as the sender name when sending emails .Displayed in the dashboard for easier search")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public InboxDto domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* ID of custom domain used by the inbox if any
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of custom domain used by the inbox if any")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public InboxDto description(String description) {
this.description = description;
return this;
}
/**
* Description of an inbox for labelling and searching purposes
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Description of an inbox for labelling and searching purposes")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public InboxDto emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The inbox's email address. Inbox projections and previews may not include the email address. To view the email address fetch the inbox entity directly. Send an email to this address and the inbox will receive and store it for you. Note the email address in MailSlurp match characters exactly and are case sensitive so `+123` additions are considered different addresses. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public InboxDto expiresAt(String expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.
* @return expiresAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Inbox expiration time. When, if ever, the inbox should expire and be deleted. If null then this inbox is permanent and the emails in it won't be deleted. This is the default behavior unless expiration date is set. If an expiration date is set and the time is reached MailSlurp will expire the inbox and move it to an expired inbox entity. You can still access the emails belonging to it but it can no longer send or receive email.")
public String getExpiresAt() {
return expiresAt;
}
public void setExpiresAt(String expiresAt) {
this.expiresAt = expiresAt;
}
public InboxDto favourite(Boolean favourite) {
this.favourite = favourite;
return this;
}
/**
* Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering
* @return favourite
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the inbox a favorite inbox. Make an inbox a favorite is typically done in the dashboard for quick access or filtering")
public Boolean getFavourite() {
return favourite;
}
public void setFavourite(Boolean favourite) {
this.favourite = favourite;
}
public InboxDto tags(List<String> tags) {
this.tags = tags;
return this;
}
public InboxDto addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public InboxDto inboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
return this;
}
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
* @return inboxType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).")
public InboxTypeEnum getInboxType() {
return inboxType;
}
public void setInboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
}
public InboxDto readOnly(Boolean readOnly) {
this.readOnly = readOnly;
return this;
}
/**
* Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes.
* @return readOnly
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is the inbox readOnly for the caller. Read only means can not be deleted or modified. This flag is present when using team accounts and shared inboxes.")
public Boolean getReadOnly() {
return readOnly;
}
public void setReadOnly(Boolean readOnly) {
this.readOnly = readOnly;
}
public InboxDto virtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
return this;
}
/**
* Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.
* @return virtualInbox
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Virtual inbox can receive email but will not send emails to real recipients. Will save sent email record but never send an actual email. Perfect for testing mail server actions.")
public Boolean getVirtualInbox() {
return virtualInbox;
}
public void setVirtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxDto inboxDto = (InboxDto) o;
return Objects.equals(this.id, inboxDto.id) &&
Objects.equals(this.userId, inboxDto.userId) &&
Objects.equals(this.createdAt, inboxDto.createdAt) &&
Objects.equals(this.name, inboxDto.name) &&
Objects.equals(this.domainId, inboxDto.domainId) &&
Objects.equals(this.description, inboxDto.description) &&
Objects.equals(this.emailAddress, inboxDto.emailAddress) &&
Objects.equals(this.expiresAt, inboxDto.expiresAt) &&
Objects.equals(this.favourite, inboxDto.favourite) &&
Objects.equals(this.tags, inboxDto.tags) &&
Objects.equals(this.inboxType, inboxDto.inboxType) &&
Objects.equals(this.readOnly, inboxDto.readOnly) &&
Objects.equals(this.virtualInbox, inboxDto.virtualInbox);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, createdAt, name, domainId, description, emailAddress, expiresAt, favourite, tags, inboxType, readOnly, virtualInbox);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
sb.append(" favourite: ").append(toIndentedString(favourite)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" inboxType: ").append(toIndentedString(inboxType)).append("\n");
sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n");
sb.append(" virtualInbox: ").append(toIndentedString(virtualInbox)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("name");
openapiFields.add("domainId");
openapiFields.add("description");
openapiFields.add("emailAddress");
openapiFields.add("expiresAt");
openapiFields.add("favourite");
openapiFields.add("tags");
openapiFields.add("inboxType");
openapiFields.add("readOnly");
openapiFields.add("virtualInbox");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("favourite");
openapiRequiredFields.add("readOnly");
openapiRequiredFields.add("virtualInbox");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxDto is not found in the empty JSON string", InboxDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonNull()) && !jsonObj.get("expiresAt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
if ((jsonObj.get("inboxType") != null && !jsonObj.get("inboxType").isJsonNull()) && !jsonObj.get("inboxType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxDto.class));
return (TypeAdapter<T>) new TypeAdapter<InboxDto>() {
@Override
public void write(JsonWriter out, InboxDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxDto
* @throws IOException if the JSON string is invalid with respect to InboxDto
*/
public static InboxDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxDto.class);
}
/**
* Convert an instance of InboxDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of search for inbox by name
*/
@ApiModel(description = "Result of search for inbox by name")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxByNameResult {
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_EXISTS = "exists";
@SerializedName(SERIALIZED_NAME_EXISTS)
private Boolean exists;
public InboxByNameResult() {
}
public InboxByNameResult inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxByNameResult exists(Boolean exists) {
this.exists = exists;
return this;
}
/**
* Get exists
* @return exists
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getExists() {
return exists;
}
public void setExists(Boolean exists) {
this.exists = exists;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxByNameResult inboxByNameResult = (InboxByNameResult) o;
return Objects.equals(this.inboxId, inboxByNameResult.inboxId) &&
Objects.equals(this.exists, inboxByNameResult.exists);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(inboxId, exists);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxByNameResult {\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" exists: ").append(toIndentedString(exists)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxId");
openapiFields.add("exists");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("exists");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxByNameResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxByNameResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxByNameResult is not found in the empty JSON string", InboxByNameResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxByNameResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxByNameResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxByNameResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxByNameResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxByNameResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxByNameResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxByNameResult.class));
return (TypeAdapter<T>) new TypeAdapter<InboxByNameResult>() {
@Override
public void write(JsonWriter out, InboxByNameResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxByNameResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxByNameResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxByNameResult
* @throws IOException if the JSON string is invalid with respect to InboxByNameResult
*/
public static InboxByNameResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxByNameResult.class);
}
/**
* Convert an instance of InboxByNameResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result of search for inbox by email address
*/
@ApiModel(description = "Result of search for inbox by email address")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class InboxByEmailAddressResult {
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_EXISTS = "exists";
@SerializedName(SERIALIZED_NAME_EXISTS)
private Boolean exists;
public InboxByEmailAddressResult() {
}
public InboxByEmailAddressResult inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public InboxByEmailAddressResult exists(Boolean exists) {
this.exists = exists;
return this;
}
/**
* Get exists
* @return exists
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getExists() {
return exists;
}
public void setExists(Boolean exists) {
this.exists = exists;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InboxByEmailAddressResult inboxByEmailAddressResult = (InboxByEmailAddressResult) o;
return Objects.equals(this.inboxId, inboxByEmailAddressResult.inboxId) &&
Objects.equals(this.exists, inboxByEmailAddressResult.exists);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(inboxId, exists);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InboxByEmailAddressResult {\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" exists: ").append(toIndentedString(exists)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxId");
openapiFields.add("exists");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("exists");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InboxByEmailAddressResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!InboxByEmailAddressResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in InboxByEmailAddressResult is not found in the empty JSON string", InboxByEmailAddressResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!InboxByEmailAddressResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InboxByEmailAddressResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : InboxByEmailAddressResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InboxByEmailAddressResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InboxByEmailAddressResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InboxByEmailAddressResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InboxByEmailAddressResult.class));
return (TypeAdapter<T>) new TypeAdapter<InboxByEmailAddressResult>() {
@Override
public void write(JsonWriter out, InboxByEmailAddressResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public InboxByEmailAddressResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of InboxByEmailAddressResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of InboxByEmailAddressResult
* @throws IOException if the JSON string is invalid with respect to InboxByEmailAddressResult
*/
public static InboxByEmailAddressResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InboxByEmailAddressResult.class);
}
/**
* Convert an instance of InboxByEmailAddressResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Access details for inbox using SMTP or IMAP
*/
@ApiModel(description = "Access details for inbox using SMTP or IMAP")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ImapSmtpAccessDetails {
public static final String SERIALIZED_NAME_SECURE_SMTP_SERVER_HOST = "secureSmtpServerHost";
@SerializedName(SERIALIZED_NAME_SECURE_SMTP_SERVER_HOST)
private String secureSmtpServerHost;
public static final String SERIALIZED_NAME_SECURE_SMTP_SERVER_PORT = "secureSmtpServerPort";
@SerializedName(SERIALIZED_NAME_SECURE_SMTP_SERVER_PORT)
private Integer secureSmtpServerPort;
public static final String SERIALIZED_NAME_SECURE_SMTP_USERNAME = "secureSmtpUsername";
@SerializedName(SERIALIZED_NAME_SECURE_SMTP_USERNAME)
private String secureSmtpUsername;
public static final String SERIALIZED_NAME_SECURE_SMTP_PASSWORD = "secureSmtpPassword";
@SerializedName(SERIALIZED_NAME_SECURE_SMTP_PASSWORD)
private String secureSmtpPassword;
public static final String SERIALIZED_NAME_SMTP_SERVER_HOST = "smtpServerHost";
@SerializedName(SERIALIZED_NAME_SMTP_SERVER_HOST)
private String smtpServerHost;
public static final String SERIALIZED_NAME_SMTP_SERVER_PORT = "smtpServerPort";
@SerializedName(SERIALIZED_NAME_SMTP_SERVER_PORT)
private Integer smtpServerPort;
public static final String SERIALIZED_NAME_SMTP_USERNAME = "smtpUsername";
@SerializedName(SERIALIZED_NAME_SMTP_USERNAME)
private String smtpUsername;
public static final String SERIALIZED_NAME_SMTP_PASSWORD = "smtpPassword";
@SerializedName(SERIALIZED_NAME_SMTP_PASSWORD)
private String smtpPassword;
public static final String SERIALIZED_NAME_IMAP_SERVER_HOST = "imapServerHost";
@SerializedName(SERIALIZED_NAME_IMAP_SERVER_HOST)
private String imapServerHost;
public static final String SERIALIZED_NAME_IMAP_SERVER_PORT = "imapServerPort";
@SerializedName(SERIALIZED_NAME_IMAP_SERVER_PORT)
private Integer imapServerPort;
public static final String SERIALIZED_NAME_IMAP_USERNAME = "imapUsername";
@SerializedName(SERIALIZED_NAME_IMAP_USERNAME)
private String imapUsername;
public static final String SERIALIZED_NAME_IMAP_PASSWORD = "imapPassword";
@SerializedName(SERIALIZED_NAME_IMAP_PASSWORD)
private String imapPassword;
public ImapSmtpAccessDetails() {
}
public ImapSmtpAccessDetails secureSmtpServerHost(String secureSmtpServerHost) {
this.secureSmtpServerHost = secureSmtpServerHost;
return this;
}
/**
* Secure TLS SMTP server host domain
* @return secureSmtpServerHost
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Secure TLS SMTP server host domain")
public String getSecureSmtpServerHost() {
return secureSmtpServerHost;
}
public void setSecureSmtpServerHost(String secureSmtpServerHost) {
this.secureSmtpServerHost = secureSmtpServerHost;
}
public ImapSmtpAccessDetails secureSmtpServerPort(Integer secureSmtpServerPort) {
this.secureSmtpServerPort = secureSmtpServerPort;
return this;
}
/**
* Secure TLS SMTP server host port
* @return secureSmtpServerPort
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Secure TLS SMTP server host port")
public Integer getSecureSmtpServerPort() {
return secureSmtpServerPort;
}
public void setSecureSmtpServerPort(Integer secureSmtpServerPort) {
this.secureSmtpServerPort = secureSmtpServerPort;
}
public ImapSmtpAccessDetails secureSmtpUsername(String secureSmtpUsername) {
this.secureSmtpUsername = secureSmtpUsername;
return this;
}
/**
* Secure TLS SMTP username for login
* @return secureSmtpUsername
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Secure TLS SMTP username for login")
public String getSecureSmtpUsername() {
return secureSmtpUsername;
}
public void setSecureSmtpUsername(String secureSmtpUsername) {
this.secureSmtpUsername = secureSmtpUsername;
}
public ImapSmtpAccessDetails secureSmtpPassword(String secureSmtpPassword) {
this.secureSmtpPassword = secureSmtpPassword;
return this;
}
/**
* Secure TLS SMTP password for login
* @return secureSmtpPassword
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Secure TLS SMTP password for login")
public String getSecureSmtpPassword() {
return secureSmtpPassword;
}
public void setSecureSmtpPassword(String secureSmtpPassword) {
this.secureSmtpPassword = secureSmtpPassword;
}
public ImapSmtpAccessDetails smtpServerHost(String smtpServerHost) {
this.smtpServerHost = smtpServerHost;
return this;
}
/**
* SMTP server host domain
* @return smtpServerHost
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "SMTP server host domain")
public String getSmtpServerHost() {
return smtpServerHost;
}
public void setSmtpServerHost(String smtpServerHost) {
this.smtpServerHost = smtpServerHost;
}
public ImapSmtpAccessDetails smtpServerPort(Integer smtpServerPort) {
this.smtpServerPort = smtpServerPort;
return this;
}
/**
* SMTP server host port
* @return smtpServerPort
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "SMTP server host port")
public Integer getSmtpServerPort() {
return smtpServerPort;
}
public void setSmtpServerPort(Integer smtpServerPort) {
this.smtpServerPort = smtpServerPort;
}
public ImapSmtpAccessDetails smtpUsername(String smtpUsername) {
this.smtpUsername = smtpUsername;
return this;
}
/**
* SMTP username for login
* @return smtpUsername
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "SMTP username for login")
public String getSmtpUsername() {
return smtpUsername;
}
public void setSmtpUsername(String smtpUsername) {
this.smtpUsername = smtpUsername;
}
public ImapSmtpAccessDetails smtpPassword(String smtpPassword) {
this.smtpPassword = smtpPassword;
return this;
}
/**
* SMTP password for login
* @return smtpPassword
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "SMTP password for login")
public String getSmtpPassword() {
return smtpPassword;
}
public void setSmtpPassword(String smtpPassword) {
this.smtpPassword = smtpPassword;
}
public ImapSmtpAccessDetails imapServerHost(String imapServerHost) {
this.imapServerHost = imapServerHost;
return this;
}
/**
* IMAP server host domain
* @return imapServerHost
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "IMAP server host domain")
public String getImapServerHost() {
return imapServerHost;
}
public void setImapServerHost(String imapServerHost) {
this.imapServerHost = imapServerHost;
}
public ImapSmtpAccessDetails imapServerPort(Integer imapServerPort) {
this.imapServerPort = imapServerPort;
return this;
}
/**
* IMAP server host port
* @return imapServerPort
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "IMAP server host port")
public Integer getImapServerPort() {
return imapServerPort;
}
public void setImapServerPort(Integer imapServerPort) {
this.imapServerPort = imapServerPort;
}
public ImapSmtpAccessDetails imapUsername(String imapUsername) {
this.imapUsername = imapUsername;
return this;
}
/**
* IMAP username for login
* @return imapUsername
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "IMAP username for login")
public String getImapUsername() {
return imapUsername;
}
public void setImapUsername(String imapUsername) {
this.imapUsername = imapUsername;
}
public ImapSmtpAccessDetails imapPassword(String imapPassword) {
this.imapPassword = imapPassword;
return this;
}
/**
* IMAP password for login
* @return imapPassword
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "IMAP password for login")
public String getImapPassword() {
return imapPassword;
}
public void setImapPassword(String imapPassword) {
this.imapPassword = imapPassword;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ImapSmtpAccessDetails imapSmtpAccessDetails = (ImapSmtpAccessDetails) o;
return Objects.equals(this.secureSmtpServerHost, imapSmtpAccessDetails.secureSmtpServerHost) &&
Objects.equals(this.secureSmtpServerPort, imapSmtpAccessDetails.secureSmtpServerPort) &&
Objects.equals(this.secureSmtpUsername, imapSmtpAccessDetails.secureSmtpUsername) &&
Objects.equals(this.secureSmtpPassword, imapSmtpAccessDetails.secureSmtpPassword) &&
Objects.equals(this.smtpServerHost, imapSmtpAccessDetails.smtpServerHost) &&
Objects.equals(this.smtpServerPort, imapSmtpAccessDetails.smtpServerPort) &&
Objects.equals(this.smtpUsername, imapSmtpAccessDetails.smtpUsername) &&
Objects.equals(this.smtpPassword, imapSmtpAccessDetails.smtpPassword) &&
Objects.equals(this.imapServerHost, imapSmtpAccessDetails.imapServerHost) &&
Objects.equals(this.imapServerPort, imapSmtpAccessDetails.imapServerPort) &&
Objects.equals(this.imapUsername, imapSmtpAccessDetails.imapUsername) &&
Objects.equals(this.imapPassword, imapSmtpAccessDetails.imapPassword);
}
@Override
public int hashCode() {
return Objects.hash(secureSmtpServerHost, secureSmtpServerPort, secureSmtpUsername, secureSmtpPassword, smtpServerHost, smtpServerPort, smtpUsername, smtpPassword, imapServerHost, imapServerPort, imapUsername, imapPassword);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ImapSmtpAccessDetails {\n");
sb.append(" secureSmtpServerHost: ").append(toIndentedString(secureSmtpServerHost)).append("\n");
sb.append(" secureSmtpServerPort: ").append(toIndentedString(secureSmtpServerPort)).append("\n");
sb.append(" secureSmtpUsername: ").append(toIndentedString(secureSmtpUsername)).append("\n");
sb.append(" secureSmtpPassword: ").append(toIndentedString(secureSmtpPassword)).append("\n");
sb.append(" smtpServerHost: ").append(toIndentedString(smtpServerHost)).append("\n");
sb.append(" smtpServerPort: ").append(toIndentedString(smtpServerPort)).append("\n");
sb.append(" smtpUsername: ").append(toIndentedString(smtpUsername)).append("\n");
sb.append(" smtpPassword: ").append(toIndentedString(smtpPassword)).append("\n");
sb.append(" imapServerHost: ").append(toIndentedString(imapServerHost)).append("\n");
sb.append(" imapServerPort: ").append(toIndentedString(imapServerPort)).append("\n");
sb.append(" imapUsername: ").append(toIndentedString(imapUsername)).append("\n");
sb.append(" imapPassword: ").append(toIndentedString(imapPassword)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("secureSmtpServerHost");
openapiFields.add("secureSmtpServerPort");
openapiFields.add("secureSmtpUsername");
openapiFields.add("secureSmtpPassword");
openapiFields.add("smtpServerHost");
openapiFields.add("smtpServerPort");
openapiFields.add("smtpUsername");
openapiFields.add("smtpPassword");
openapiFields.add("imapServerHost");
openapiFields.add("imapServerPort");
openapiFields.add("imapUsername");
openapiFields.add("imapPassword");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("secureSmtpServerHost");
openapiRequiredFields.add("secureSmtpServerPort");
openapiRequiredFields.add("secureSmtpUsername");
openapiRequiredFields.add("secureSmtpPassword");
openapiRequiredFields.add("smtpServerHost");
openapiRequiredFields.add("smtpServerPort");
openapiRequiredFields.add("smtpUsername");
openapiRequiredFields.add("smtpPassword");
openapiRequiredFields.add("imapServerHost");
openapiRequiredFields.add("imapServerPort");
openapiRequiredFields.add("imapUsername");
openapiRequiredFields.add("imapPassword");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ImapSmtpAccessDetails
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ImapSmtpAccessDetails.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ImapSmtpAccessDetails is not found in the empty JSON string", ImapSmtpAccessDetails.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ImapSmtpAccessDetails.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ImapSmtpAccessDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ImapSmtpAccessDetails.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("secureSmtpServerHost").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `secureSmtpServerHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secureSmtpServerHost").toString()));
}
if (!jsonObj.get("secureSmtpUsername").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `secureSmtpUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secureSmtpUsername").toString()));
}
if (!jsonObj.get("secureSmtpPassword").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `secureSmtpPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secureSmtpPassword").toString()));
}
if (!jsonObj.get("smtpServerHost").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `smtpServerHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpServerHost").toString()));
}
if (!jsonObj.get("smtpUsername").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `smtpUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpUsername").toString()));
}
if (!jsonObj.get("smtpPassword").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `smtpPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpPassword").toString()));
}
if (!jsonObj.get("imapServerHost").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `imapServerHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imapServerHost").toString()));
}
if (!jsonObj.get("imapUsername").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `imapUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imapUsername").toString()));
}
if (!jsonObj.get("imapPassword").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `imapPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imapPassword").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ImapSmtpAccessDetails.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ImapSmtpAccessDetails' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ImapSmtpAccessDetails> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ImapSmtpAccessDetails.class));
return (TypeAdapter<T>) new TypeAdapter<ImapSmtpAccessDetails>() {
@Override
public void write(JsonWriter out, ImapSmtpAccessDetails value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ImapSmtpAccessDetails read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ImapSmtpAccessDetails given an JSON string
*
* @param jsonString JSON string
* @return An instance of ImapSmtpAccessDetails
* @throws IOException if the JSON string is invalid with respect to ImapSmtpAccessDetails
*/
public static ImapSmtpAccessDetails fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ImapSmtpAccessDetails.class);
}
/**
* Convert an instance of ImapSmtpAccessDetails to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* IMAP operation flags
*/
@ApiModel(description = "IMAP operation flags")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ImapFlagOperationOptions {
/**
* Gets or Sets flagOperation
*/
@JsonAdapter(FlagOperationEnum.Adapter.class)
public enum FlagOperationEnum {
SET_FLAGS("SET_FLAGS"),
ADD_FLAGS("ADD_FLAGS"),
REMOVE_FLAGS("REMOVE_FLAGS");
private String value;
FlagOperationEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FlagOperationEnum fromValue(String value) {
for (FlagOperationEnum b : FlagOperationEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FlagOperationEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FlagOperationEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FlagOperationEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FlagOperationEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FLAG_OPERATION = "flagOperation";
@SerializedName(SERIALIZED_NAME_FLAG_OPERATION)
private FlagOperationEnum flagOperation;
public static final String SERIALIZED_NAME_FLAGS = "flags";
@SerializedName(SERIALIZED_NAME_FLAGS)
private List<String> flags = new ArrayList<>();
public ImapFlagOperationOptions() {
}
public ImapFlagOperationOptions flagOperation(FlagOperationEnum flagOperation) {
this.flagOperation = flagOperation;
return this;
}
/**
* Get flagOperation
* @return flagOperation
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public FlagOperationEnum getFlagOperation() {
return flagOperation;
}
public void setFlagOperation(FlagOperationEnum flagOperation) {
this.flagOperation = flagOperation;
}
public ImapFlagOperationOptions flags(List<String> flags) {
this.flags = flags;
return this;
}
public ImapFlagOperationOptions addFlagsItem(String flagsItem) {
this.flags.add(flagsItem);
return this;
}
/**
* Get flags
* @return flags
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getFlags() {
return flags;
}
public void setFlags(List<String> flags) {
this.flags = flags;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ImapFlagOperationOptions imapFlagOperationOptions = (ImapFlagOperationOptions) o;
return Objects.equals(this.flagOperation, imapFlagOperationOptions.flagOperation) &&
Objects.equals(this.flags, imapFlagOperationOptions.flags);
}
@Override
public int hashCode() {
return Objects.hash(flagOperation, flags);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ImapFlagOperationOptions {\n");
sb.append(" flagOperation: ").append(toIndentedString(flagOperation)).append("\n");
sb.append(" flags: ").append(toIndentedString(flags)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("flagOperation");
openapiFields.add("flags");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("flagOperation");
openapiRequiredFields.add("flags");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ImapFlagOperationOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ImapFlagOperationOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ImapFlagOperationOptions is not found in the empty JSON string", ImapFlagOperationOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ImapFlagOperationOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ImapFlagOperationOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ImapFlagOperationOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("flagOperation").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `flagOperation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flagOperation").toString()));
}
// ensure the required json array is present
if (jsonObj.get("flags") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("flags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `flags` to be an array in the JSON string but got `%s`", jsonObj.get("flags").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ImapFlagOperationOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ImapFlagOperationOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ImapFlagOperationOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ImapFlagOperationOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ImapFlagOperationOptions>() {
@Override
public void write(JsonWriter out, ImapFlagOperationOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ImapFlagOperationOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ImapFlagOperationOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ImapFlagOperationOptions
* @throws IOException if the JSON string is invalid with respect to ImapFlagOperationOptions
*/
public static ImapFlagOperationOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ImapFlagOperationOptions.class);
}
/**
* Convert an instance of ImapFlagOperationOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* IP Address look up result for a given domain / hostname
*/
@ApiModel(description = "IP Address look up result for a given domain / hostname")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class IPAddressResult {
public static final String SERIALIZED_NAME_ADDRESS = "address";
@SerializedName(SERIALIZED_NAME_ADDRESS)
private String address;
public static final String SERIALIZED_NAME_HOSTNAME = "hostname";
@SerializedName(SERIALIZED_NAME_HOSTNAME)
private String hostname;
public IPAddressResult() {
}
public IPAddressResult address(String address) {
this.address = address;
return this;
}
/**
* Get address
* @return address
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public IPAddressResult hostname(String hostname) {
this.hostname = hostname;
return this;
}
/**
* Get hostname
* @return hostname
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getHostname() {
return hostname;
}
public void setHostname(String hostname) {
this.hostname = hostname;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IPAddressResult ipAddressResult = (IPAddressResult) o;
return Objects.equals(this.address, ipAddressResult.address) &&
Objects.equals(this.hostname, ipAddressResult.hostname);
}
@Override
public int hashCode() {
return Objects.hash(address, hostname);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class IPAddressResult {\n");
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append(" hostname: ").append(toIndentedString(hostname)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("address");
openapiFields.add("hostname");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("address");
openapiRequiredFields.add("hostname");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to IPAddressResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!IPAddressResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in IPAddressResult is not found in the empty JSON string", IPAddressResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!IPAddressResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IPAddressResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : IPAddressResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("address").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString()));
}
if (!jsonObj.get("hostname").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!IPAddressResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'IPAddressResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<IPAddressResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(IPAddressResult.class));
return (TypeAdapter<T>) new TypeAdapter<IPAddressResult>() {
@Override
public void write(JsonWriter out, IPAddressResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public IPAddressResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of IPAddressResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of IPAddressResult
* @throws IOException if the JSON string is invalid with respect to IPAddressResult
*/
public static IPAddressResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, IPAddressResult.class);
}
/**
* Convert an instance of IPAddressResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ValidationMessage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* HTML Validation Results
*/
@ApiModel(description = "HTML Validation Results")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class HTMLValidationResult {
public static final String SERIALIZED_NAME_IS_VALID = "isValid";
@SerializedName(SERIALIZED_NAME_IS_VALID)
private Boolean isValid;
public static final String SERIALIZED_NAME_ERRORS = "errors";
@SerializedName(SERIALIZED_NAME_ERRORS)
private List<ValidationMessage> errors = new ArrayList<>();
public static final String SERIALIZED_NAME_WARNINGS = "warnings";
@SerializedName(SERIALIZED_NAME_WARNINGS)
private List<ValidationMessage> warnings = new ArrayList<>();
public HTMLValidationResult() {
}
public HTMLValidationResult isValid(Boolean isValid) {
this.isValid = isValid;
return this;
}
/**
* Is HTML validation result valid
* @return isValid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Is HTML validation result valid")
public Boolean getIsValid() {
return isValid;
}
public void setIsValid(Boolean isValid) {
this.isValid = isValid;
}
public HTMLValidationResult errors(List<ValidationMessage> errors) {
this.errors = errors;
return this;
}
public HTMLValidationResult addErrorsItem(ValidationMessage errorsItem) {
this.errors.add(errorsItem);
return this;
}
/**
* Optional errors resulting from HTML validation
* @return errors
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Optional errors resulting from HTML validation")
public List<ValidationMessage> getErrors() {
return errors;
}
public void setErrors(List<ValidationMessage> errors) {
this.errors = errors;
}
public HTMLValidationResult warnings(List<ValidationMessage> warnings) {
this.warnings = warnings;
return this;
}
public HTMLValidationResult addWarningsItem(ValidationMessage warningsItem) {
this.warnings.add(warningsItem);
return this;
}
/**
* Optional warnings resulting from HTML validation
* @return warnings
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Optional warnings resulting from HTML validation")
public List<ValidationMessage> getWarnings() {
return warnings;
}
public void setWarnings(List<ValidationMessage> warnings) {
this.warnings = warnings;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HTMLValidationResult htMLValidationResult = (HTMLValidationResult) o;
return Objects.equals(this.isValid, htMLValidationResult.isValid) &&
Objects.equals(this.errors, htMLValidationResult.errors) &&
Objects.equals(this.warnings, htMLValidationResult.warnings);
}
@Override
public int hashCode() {
return Objects.hash(isValid, errors, warnings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class HTMLValidationResult {\n");
sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n");
sb.append(" errors: ").append(toIndentedString(errors)).append("\n");
sb.append(" warnings: ").append(toIndentedString(warnings)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("isValid");
openapiFields.add("errors");
openapiFields.add("warnings");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("isValid");
openapiRequiredFields.add("errors");
openapiRequiredFields.add("warnings");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to HTMLValidationResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!HTMLValidationResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in HTMLValidationResult is not found in the empty JSON string", HTMLValidationResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!HTMLValidationResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HTMLValidationResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : HTMLValidationResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("errors").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString()));
}
JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors");
// validate the required field `errors` (array)
for (int i = 0; i < jsonArrayerrors.size(); i++) {
ValidationMessage.validateJsonObject(jsonArrayerrors.get(i).getAsJsonObject());
};
// ensure the json data is an array
if (!jsonObj.get("warnings").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `warnings` to be an array in the JSON string but got `%s`", jsonObj.get("warnings").toString()));
}
JsonArray jsonArraywarnings = jsonObj.getAsJsonArray("warnings");
// validate the required field `warnings` (array)
for (int i = 0; i < jsonArraywarnings.size(); i++) {
ValidationMessage.validateJsonObject(jsonArraywarnings.get(i).getAsJsonObject());
};
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!HTMLValidationResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'HTMLValidationResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<HTMLValidationResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(HTMLValidationResult.class));
return (TypeAdapter<T>) new TypeAdapter<HTMLValidationResult>() {
@Override
public void write(JsonWriter out, HTMLValidationResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public HTMLValidationResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of HTMLValidationResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of HTMLValidationResult
* @throws IOException if the JSON string is invalid with respect to HTMLValidationResult
*/
public static HTMLValidationResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, HTMLValidationResult.class);
}
/**
* Convert an instance of HTMLValidationResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Data for contact group
*/
@ApiModel(description = "Data for contact group")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class GroupProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public GroupProjection() {
}
public GroupProjection name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public GroupProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public GroupProjection description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public GroupProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GroupProjection groupProjection = (GroupProjection) o;
return Objects.equals(this.name, groupProjection.name) &&
Objects.equals(this.id, groupProjection.id) &&
Objects.equals(this.description, groupProjection.description) &&
Objects.equals(this.createdAt, groupProjection.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(name, id, description, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GroupProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("id");
openapiFields.add("description");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to GroupProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!GroupProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in GroupProjection is not found in the empty JSON string", GroupProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!GroupProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : GroupProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!GroupProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'GroupProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<GroupProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(GroupProjection.class));
return (TypeAdapter<T>) new TypeAdapter<GroupProjection>() {
@Override
public void write(JsonWriter out, GroupProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public GroupProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of GroupProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of GroupProjection
* @throws IOException if the JSON string is invalid with respect to GroupProjection
*/
public static GroupProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, GroupProjection.class);
}
/**
* Convert an instance of GroupProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Contact group data
*/
@ApiModel(description = "Contact group data")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class GroupDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public GroupDto() {
}
public GroupDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public GroupDto name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public GroupDto description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public GroupDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GroupDto groupDto = (GroupDto) o;
return Objects.equals(this.id, groupDto.id) &&
Objects.equals(this.name, groupDto.name) &&
Objects.equals(this.description, groupDto.description) &&
Objects.equals(this.createdAt, groupDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, name, description, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GroupDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("name");
openapiFields.add("description");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("name");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to GroupDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!GroupDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in GroupDto is not found in the empty JSON string", GroupDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!GroupDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : GroupDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!GroupDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'GroupDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<GroupDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(GroupDto.class));
return (TypeAdapter<T>) new TypeAdapter<GroupDto>() {
@Override
public void write(JsonWriter out, GroupDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public GroupDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of GroupDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of GroupDto
* @throws IOException if the JSON string is invalid with respect to GroupDto
*/
public static GroupDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, GroupDto.class);
}
/**
* Convert an instance of GroupDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ContactDto;
import com.mailslurp.models.GroupDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Describes contacts attached to a contact group
*/
@ApiModel(description = "Describes contacts attached to a contact group")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class GroupContactsDto {
public static final String SERIALIZED_NAME_GROUP = "group";
@SerializedName(SERIALIZED_NAME_GROUP)
private GroupDto group;
public static final String SERIALIZED_NAME_CONTACTS = "contacts";
@SerializedName(SERIALIZED_NAME_CONTACTS)
private List<ContactDto> contacts = new ArrayList<>();
public GroupContactsDto() {
}
public GroupContactsDto group(GroupDto group) {
this.group = group;
return this;
}
/**
* Get group
* @return group
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public GroupDto getGroup() {
return group;
}
public void setGroup(GroupDto group) {
this.group = group;
}
public GroupContactsDto contacts(List<ContactDto> contacts) {
this.contacts = contacts;
return this;
}
public GroupContactsDto addContactsItem(ContactDto contactsItem) {
this.contacts.add(contactsItem);
return this;
}
/**
* Get contacts
* @return contacts
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<ContactDto> getContacts() {
return contacts;
}
public void setContacts(List<ContactDto> contacts) {
this.contacts = contacts;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GroupContactsDto groupContactsDto = (GroupContactsDto) o;
return Objects.equals(this.group, groupContactsDto.group) &&
Objects.equals(this.contacts, groupContactsDto.contacts);
}
@Override
public int hashCode() {
return Objects.hash(group, contacts);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GroupContactsDto {\n");
sb.append(" group: ").append(toIndentedString(group)).append("\n");
sb.append(" contacts: ").append(toIndentedString(contacts)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("group");
openapiFields.add("contacts");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("group");
openapiRequiredFields.add("contacts");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to GroupContactsDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!GroupContactsDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContactsDto is not found in the empty JSON string", GroupContactsDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!GroupContactsDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupContactsDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : GroupContactsDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// validate the required field `group`
GroupDto.validateJsonObject(jsonObj.getAsJsonObject("group"));
// ensure the json data is an array
if (!jsonObj.get("contacts").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `contacts` to be an array in the JSON string but got `%s`", jsonObj.get("contacts").toString()));
}
JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts");
// validate the required field `contacts` (array)
for (int i = 0; i < jsonArraycontacts.size(); i++) {
ContactDto.validateJsonObject(jsonArraycontacts.get(i).getAsJsonObject());
};
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!GroupContactsDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'GroupContactsDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<GroupContactsDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(GroupContactsDto.class));
return (TypeAdapter<T>) new TypeAdapter<GroupContactsDto>() {
@Override
public void write(JsonWriter out, GroupContactsDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public GroupContactsDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of GroupContactsDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of GroupContactsDto
* @throws IOException if the JSON string is invalid with respect to GroupContactsDto
*/
public static GroupContactsDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, GroupContactsDto.class);
}
/**
* Convert an instance of GroupContactsDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* User image
*/
@ApiModel(description = "User image")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class GravatarUrl {
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
public static final String SERIALIZED_NAME_HASH = "hash";
@SerializedName(SERIALIZED_NAME_HASH)
private String hash;
public GravatarUrl() {
}
public GravatarUrl url(String url) {
this.url = url;
return this;
}
/**
* Get url
* @return url
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public GravatarUrl hash(String hash) {
this.hash = hash;
return this;
}
/**
* Get hash
* @return hash
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GravatarUrl gravatarUrl = (GravatarUrl) o;
return Objects.equals(this.url, gravatarUrl.url) &&
Objects.equals(this.hash, gravatarUrl.hash);
}
@Override
public int hashCode() {
return Objects.hash(url, hash);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GravatarUrl {\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" hash: ").append(toIndentedString(hash)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("url");
openapiFields.add("hash");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("url");
openapiRequiredFields.add("hash");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to GravatarUrl
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!GravatarUrl.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in GravatarUrl is not found in the empty JSON string", GravatarUrl.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!GravatarUrl.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GravatarUrl` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : GravatarUrl.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("url").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString()));
}
if (!jsonObj.get("hash").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!GravatarUrl.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'GravatarUrl' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<GravatarUrl> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(GravatarUrl.class));
return (TypeAdapter<T>) new TypeAdapter<GravatarUrl>() {
@Override
public void write(JsonWriter out, GravatarUrl value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public GravatarUrl read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of GravatarUrl given an JSON string
*
* @param jsonString JSON string
* @return An instance of GravatarUrl
* @throws IOException if the JSON string is invalid with respect to GravatarUrl
*/
public static GravatarUrl fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, GravatarUrl.class);
}
/**
* Convert an instance of GravatarUrl to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for forwarding an email
*/
@ApiModel(description = "Options for forwarding an email")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ForwardEmailOptions {
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_USE_INBOX_NAME = "useInboxName";
@SerializedName(SERIALIZED_NAME_USE_INBOX_NAME)
private Boolean useInboxName;
public static final String SERIALIZED_NAME_FILTER_BOUNCED_RECIPIENTS = "filterBouncedRecipients";
@SerializedName(SERIALIZED_NAME_FILTER_BOUNCED_RECIPIENTS)
private Boolean filterBouncedRecipients;
public ForwardEmailOptions() {
}
public ForwardEmailOptions to(List<String> to) {
this.to = to;
return this;
}
public ForwardEmailOptions addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* To recipients for forwarded email
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "To recipients for forwarded email")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public ForwardEmailOptions subject(String subject) {
this.subject = subject;
return this;
}
/**
* Subject for forwarded email
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Subject for forwarded email")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public ForwardEmailOptions cc(List<String> cc) {
this.cc = cc;
return this;
}
public ForwardEmailOptions addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* Optional cc recipients
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional cc recipients")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public ForwardEmailOptions bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public ForwardEmailOptions addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* Optional bcc recipients
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional bcc recipients")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public ForwardEmailOptions from(String from) {
this.from = from;
return this;
}
/**
* Optional from override
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional from override")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public ForwardEmailOptions useInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
return this;
}
/**
* Optionally use inbox name as display name for sender email address
* @return useInboxName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optionally use inbox name as display name for sender email address")
public Boolean getUseInboxName() {
return useInboxName;
}
public void setUseInboxName(Boolean useInboxName) {
this.useInboxName = useInboxName;
}
public ForwardEmailOptions filterBouncedRecipients(Boolean filterBouncedRecipients) {
this.filterBouncedRecipients = filterBouncedRecipients;
return this;
}
/**
* Filter recipients to remove any bounced recipients from to, bcc, and cc before sending
* @return filterBouncedRecipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Filter recipients to remove any bounced recipients from to, bcc, and cc before sending")
public Boolean getFilterBouncedRecipients() {
return filterBouncedRecipients;
}
public void setFilterBouncedRecipients(Boolean filterBouncedRecipients) {
this.filterBouncedRecipients = filterBouncedRecipients;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ForwardEmailOptions forwardEmailOptions = (ForwardEmailOptions) o;
return Objects.equals(this.to, forwardEmailOptions.to) &&
Objects.equals(this.subject, forwardEmailOptions.subject) &&
Objects.equals(this.cc, forwardEmailOptions.cc) &&
Objects.equals(this.bcc, forwardEmailOptions.bcc) &&
Objects.equals(this.from, forwardEmailOptions.from) &&
Objects.equals(this.useInboxName, forwardEmailOptions.useInboxName) &&
Objects.equals(this.filterBouncedRecipients, forwardEmailOptions.filterBouncedRecipients);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(to, subject, cc, bcc, from, useInboxName, filterBouncedRecipients);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ForwardEmailOptions {\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" useInboxName: ").append(toIndentedString(useInboxName)).append("\n");
sb.append(" filterBouncedRecipients: ").append(toIndentedString(filterBouncedRecipients)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("to");
openapiFields.add("subject");
openapiFields.add("cc");
openapiFields.add("bcc");
openapiFields.add("from");
openapiFields.add("useInboxName");
openapiFields.add("filterBouncedRecipients");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("to");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ForwardEmailOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ForwardEmailOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ForwardEmailOptions is not found in the empty JSON string", ForwardEmailOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ForwardEmailOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ForwardEmailOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ForwardEmailOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ForwardEmailOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ForwardEmailOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ForwardEmailOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ForwardEmailOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ForwardEmailOptions>() {
@Override
public void write(JsonWriter out, ForwardEmailOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ForwardEmailOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ForwardEmailOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ForwardEmailOptions
* @throws IOException if the JSON string is invalid with respect to ForwardEmailOptions
*/
public static ForwardEmailOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ForwardEmailOptions.class);
}
/**
* Convert an instance of ForwardEmailOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Result from calling expire on any inboxes that have applicable expiration dates given current time.
*/
@ApiModel(description = "Result from calling expire on any inboxes that have applicable expiration dates given current time.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class FlushExpiredInboxesResult {
public static final String SERIALIZED_NAME_INBOX_IDS = "inboxIds";
@SerializedName(SERIALIZED_NAME_INBOX_IDS)
private List<UUID> inboxIds = new ArrayList<>();
public static final String SERIALIZED_NAME_EXPIRE_BEFORE = "expireBefore";
@SerializedName(SERIALIZED_NAME_EXPIRE_BEFORE)
private OffsetDateTime expireBefore;
public FlushExpiredInboxesResult() {
}
public FlushExpiredInboxesResult inboxIds(List<UUID> inboxIds) {
this.inboxIds = inboxIds;
return this;
}
public FlushExpiredInboxesResult addInboxIdsItem(UUID inboxIdsItem) {
this.inboxIds.add(inboxIdsItem);
return this;
}
/**
* Inbox IDs affected by expiration
* @return inboxIds
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inbox IDs affected by expiration")
public List<UUID> getInboxIds() {
return inboxIds;
}
public void setInboxIds(List<UUID> inboxIds) {
this.inboxIds = inboxIds;
}
public FlushExpiredInboxesResult expireBefore(OffsetDateTime expireBefore) {
this.expireBefore = expireBefore;
return this;
}
/**
* DateTime to filter inboxes so that those expiring before this time are expired
* @return expireBefore
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "DateTime to filter inboxes so that those expiring before this time are expired")
public OffsetDateTime getExpireBefore() {
return expireBefore;
}
public void setExpireBefore(OffsetDateTime expireBefore) {
this.expireBefore = expireBefore;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FlushExpiredInboxesResult flushExpiredInboxesResult = (FlushExpiredInboxesResult) o;
return Objects.equals(this.inboxIds, flushExpiredInboxesResult.inboxIds) &&
Objects.equals(this.expireBefore, flushExpiredInboxesResult.expireBefore);
}
@Override
public int hashCode() {
return Objects.hash(inboxIds, expireBefore);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FlushExpiredInboxesResult {\n");
sb.append(" inboxIds: ").append(toIndentedString(inboxIds)).append("\n");
sb.append(" expireBefore: ").append(toIndentedString(expireBefore)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxIds");
openapiFields.add("expireBefore");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxIds");
openapiRequiredFields.add("expireBefore");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to FlushExpiredInboxesResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!FlushExpiredInboxesResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in FlushExpiredInboxesResult is not found in the empty JSON string", FlushExpiredInboxesResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!FlushExpiredInboxesResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FlushExpiredInboxesResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : FlushExpiredInboxesResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("inboxIds") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("inboxIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxIds` to be an array in the JSON string but got `%s`", jsonObj.get("inboxIds").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!FlushExpiredInboxesResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'FlushExpiredInboxesResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<FlushExpiredInboxesResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(FlushExpiredInboxesResult.class));
return (TypeAdapter<T>) new TypeAdapter<FlushExpiredInboxesResult>() {
@Override
public void write(JsonWriter out, FlushExpiredInboxesResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public FlushExpiredInboxesResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of FlushExpiredInboxesResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of FlushExpiredInboxesResult
* @throws IOException if the JSON string is invalid with respect to FlushExpiredInboxesResult
*/
public static FlushExpiredInboxesResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, FlushExpiredInboxesResult.class);
}
/**
* Convert an instance of FlushExpiredInboxesResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Remaining recipients that were filtered to remove bounced recipients
*/
@ApiModel(description = "Remaining recipients that were filtered to remove bounced recipients")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class FilterBouncedRecipientsResult {
public static final String SERIALIZED_NAME_FILTERED_RECIPIENTS = "filteredRecipients";
@SerializedName(SERIALIZED_NAME_FILTERED_RECIPIENTS)
private List<String> filteredRecipients = new ArrayList<>();
public FilterBouncedRecipientsResult() {
}
public FilterBouncedRecipientsResult filteredRecipients(List<String> filteredRecipients) {
this.filteredRecipients = filteredRecipients;
return this;
}
public FilterBouncedRecipientsResult addFilteredRecipientsItem(String filteredRecipientsItem) {
this.filteredRecipients.add(filteredRecipientsItem);
return this;
}
/**
* Get filteredRecipients
* @return filteredRecipients
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getFilteredRecipients() {
return filteredRecipients;
}
public void setFilteredRecipients(List<String> filteredRecipients) {
this.filteredRecipients = filteredRecipients;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FilterBouncedRecipientsResult filterBouncedRecipientsResult = (FilterBouncedRecipientsResult) o;
return Objects.equals(this.filteredRecipients, filterBouncedRecipientsResult.filteredRecipients);
}
@Override
public int hashCode() {
return Objects.hash(filteredRecipients);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FilterBouncedRecipientsResult {\n");
sb.append(" filteredRecipients: ").append(toIndentedString(filteredRecipients)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("filteredRecipients");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("filteredRecipients");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to FilterBouncedRecipientsResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!FilterBouncedRecipientsResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in FilterBouncedRecipientsResult is not found in the empty JSON string", FilterBouncedRecipientsResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!FilterBouncedRecipientsResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FilterBouncedRecipientsResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : FilterBouncedRecipientsResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("filteredRecipients") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("filteredRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `filteredRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("filteredRecipients").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!FilterBouncedRecipientsResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'FilterBouncedRecipientsResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<FilterBouncedRecipientsResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(FilterBouncedRecipientsResult.class));
return (TypeAdapter<T>) new TypeAdapter<FilterBouncedRecipientsResult>() {
@Override
public void write(JsonWriter out, FilterBouncedRecipientsResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public FilterBouncedRecipientsResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of FilterBouncedRecipientsResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of FilterBouncedRecipientsResult
* @throws IOException if the JSON string is invalid with respect to FilterBouncedRecipientsResult
*/
public static FilterBouncedRecipientsResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, FilterBouncedRecipientsResult.class);
}
/**
* Convert an instance of FilterBouncedRecipientsResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for filtering bounced email recipients
*/
@ApiModel(description = "Options for filtering bounced email recipients")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class FilterBouncedRecipientsOptions {
public static final String SERIALIZED_NAME_EMAIL_RECIPIENTS = "emailRecipients";
@SerializedName(SERIALIZED_NAME_EMAIL_RECIPIENTS)
private List<String> emailRecipients = new ArrayList<>();
public FilterBouncedRecipientsOptions() {
}
public FilterBouncedRecipientsOptions emailRecipients(List<String> emailRecipients) {
this.emailRecipients = emailRecipients;
return this;
}
public FilterBouncedRecipientsOptions addEmailRecipientsItem(String emailRecipientsItem) {
this.emailRecipients.add(emailRecipientsItem);
return this;
}
/**
* Get emailRecipients
* @return emailRecipients
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getEmailRecipients() {
return emailRecipients;
}
public void setEmailRecipients(List<String> emailRecipients) {
this.emailRecipients = emailRecipients;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FilterBouncedRecipientsOptions filterBouncedRecipientsOptions = (FilterBouncedRecipientsOptions) o;
return Objects.equals(this.emailRecipients, filterBouncedRecipientsOptions.emailRecipients);
}
@Override
public int hashCode() {
return Objects.hash(emailRecipients);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FilterBouncedRecipientsOptions {\n");
sb.append(" emailRecipients: ").append(toIndentedString(emailRecipients)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("emailRecipients");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("emailRecipients");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to FilterBouncedRecipientsOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!FilterBouncedRecipientsOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in FilterBouncedRecipientsOptions is not found in the empty JSON string", FilterBouncedRecipientsOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!FilterBouncedRecipientsOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FilterBouncedRecipientsOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : FilterBouncedRecipientsOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("emailRecipients") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("emailRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `emailRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("emailRecipients").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!FilterBouncedRecipientsOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'FilterBouncedRecipientsOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<FilterBouncedRecipientsOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(FilterBouncedRecipientsOptions.class));
return (TypeAdapter<T>) new TypeAdapter<FilterBouncedRecipientsOptions>() {
@Override
public void write(JsonWriter out, FilterBouncedRecipientsOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public FilterBouncedRecipientsOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of FilterBouncedRecipientsOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of FilterBouncedRecipientsOptions
* @throws IOException if the JSON string is invalid with respect to FilterBouncedRecipientsOptions
*/
public static FilterBouncedRecipientsOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, FilterBouncedRecipientsOptions.class);
}
/**
* Convert an instance of FilterBouncedRecipientsOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for exporting user data
*/
@ApiModel(description = "Options for exporting user data")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ExportOptions {
/**
* Gets or Sets outputFormat
*/
@JsonAdapter(OutputFormatEnum.Adapter.class)
public enum OutputFormatEnum {
DEFAULT("CSV_DEFAULT"),
EXCEL("CSV_EXCEL");
private String value;
OutputFormatEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static OutputFormatEnum fromValue(String value) {
for (OutputFormatEnum b : OutputFormatEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<OutputFormatEnum> {
@Override
public void write(final JsonWriter jsonWriter, final OutputFormatEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public OutputFormatEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return OutputFormatEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_OUTPUT_FORMAT = "outputFormat";
@SerializedName(SERIALIZED_NAME_OUTPUT_FORMAT)
private OutputFormatEnum outputFormat;
public static final String SERIALIZED_NAME_EXCLUDE_PREVIOUSLY_EXPORTED = "excludePreviouslyExported";
@SerializedName(SERIALIZED_NAME_EXCLUDE_PREVIOUSLY_EXPORTED)
private Boolean excludePreviouslyExported;
public static final String SERIALIZED_NAME_CREATED_EARLIEST_TIME = "createdEarliestTime";
@SerializedName(SERIALIZED_NAME_CREATED_EARLIEST_TIME)
private OffsetDateTime createdEarliestTime;
public static final String SERIALIZED_NAME_CREATED_OLDEST_TIME = "createdOldestTime";
@SerializedName(SERIALIZED_NAME_CREATED_OLDEST_TIME)
private OffsetDateTime createdOldestTime;
public static final String SERIALIZED_NAME_FILTER = "filter";
@SerializedName(SERIALIZED_NAME_FILTER)
private String filter;
public static final String SERIALIZED_NAME_LIST_SEPARATOR_TOKEN = "listSeparatorToken";
@SerializedName(SERIALIZED_NAME_LIST_SEPARATOR_TOKEN)
private String listSeparatorToken;
public ExportOptions() {
}
public ExportOptions outputFormat(OutputFormatEnum outputFormat) {
this.outputFormat = outputFormat;
return this;
}
/**
* Get outputFormat
* @return outputFormat
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OutputFormatEnum getOutputFormat() {
return outputFormat;
}
public void setOutputFormat(OutputFormatEnum outputFormat) {
this.outputFormat = outputFormat;
}
public ExportOptions excludePreviouslyExported(Boolean excludePreviouslyExported) {
this.excludePreviouslyExported = excludePreviouslyExported;
return this;
}
/**
* Get excludePreviouslyExported
* @return excludePreviouslyExported
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getExcludePreviouslyExported() {
return excludePreviouslyExported;
}
public void setExcludePreviouslyExported(Boolean excludePreviouslyExported) {
this.excludePreviouslyExported = excludePreviouslyExported;
}
public ExportOptions createdEarliestTime(OffsetDateTime createdEarliestTime) {
this.createdEarliestTime = createdEarliestTime;
return this;
}
/**
* Get createdEarliestTime
* @return createdEarliestTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getCreatedEarliestTime() {
return createdEarliestTime;
}
public void setCreatedEarliestTime(OffsetDateTime createdEarliestTime) {
this.createdEarliestTime = createdEarliestTime;
}
public ExportOptions createdOldestTime(OffsetDateTime createdOldestTime) {
this.createdOldestTime = createdOldestTime;
return this;
}
/**
* Get createdOldestTime
* @return createdOldestTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getCreatedOldestTime() {
return createdOldestTime;
}
public void setCreatedOldestTime(OffsetDateTime createdOldestTime) {
this.createdOldestTime = createdOldestTime;
}
public ExportOptions filter(String filter) {
this.filter = filter;
return this;
}
/**
* Get filter
* @return filter
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFilter() {
return filter;
}
public void setFilter(String filter) {
this.filter = filter;
}
public ExportOptions listSeparatorToken(String listSeparatorToken) {
this.listSeparatorToken = listSeparatorToken;
return this;
}
/**
* Get listSeparatorToken
* @return listSeparatorToken
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getListSeparatorToken() {
return listSeparatorToken;
}
public void setListSeparatorToken(String listSeparatorToken) {
this.listSeparatorToken = listSeparatorToken;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExportOptions exportOptions = (ExportOptions) o;
return Objects.equals(this.outputFormat, exportOptions.outputFormat) &&
Objects.equals(this.excludePreviouslyExported, exportOptions.excludePreviouslyExported) &&
Objects.equals(this.createdEarliestTime, exportOptions.createdEarliestTime) &&
Objects.equals(this.createdOldestTime, exportOptions.createdOldestTime) &&
Objects.equals(this.filter, exportOptions.filter) &&
Objects.equals(this.listSeparatorToken, exportOptions.listSeparatorToken);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(outputFormat, excludePreviouslyExported, createdEarliestTime, createdOldestTime, filter, listSeparatorToken);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExportOptions {\n");
sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).append("\n");
sb.append(" excludePreviouslyExported: ").append(toIndentedString(excludePreviouslyExported)).append("\n");
sb.append(" createdEarliestTime: ").append(toIndentedString(createdEarliestTime)).append("\n");
sb.append(" createdOldestTime: ").append(toIndentedString(createdOldestTime)).append("\n");
sb.append(" filter: ").append(toIndentedString(filter)).append("\n");
sb.append(" listSeparatorToken: ").append(toIndentedString(listSeparatorToken)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("outputFormat");
openapiFields.add("excludePreviouslyExported");
openapiFields.add("createdEarliestTime");
openapiFields.add("createdOldestTime");
openapiFields.add("filter");
openapiFields.add("listSeparatorToken");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("outputFormat");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ExportOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ExportOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExportOptions is not found in the empty JSON string", ExportOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ExportOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExportOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ExportOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("outputFormat").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `outputFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputFormat").toString()));
}
if ((jsonObj.get("filter") != null && !jsonObj.get("filter").isJsonNull()) && !jsonObj.get("filter").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `filter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filter").toString()));
}
if ((jsonObj.get("listSeparatorToken") != null && !jsonObj.get("listSeparatorToken").isJsonNull()) && !jsonObj.get("listSeparatorToken").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `listSeparatorToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("listSeparatorToken").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ExportOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExportOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ExportOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExportOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ExportOptions>() {
@Override
public void write(JsonWriter out, ExportOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ExportOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ExportOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExportOptions
* @throws IOException if the JSON string is invalid with respect to ExportOptions
*/
public static ExportOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExportOptions.class);
}
/**
* Convert an instance of ExportOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Export download link
*/
@ApiModel(description = "Export download link")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ExportLink {
public static final String SERIALIZED_NAME_DOWNLOAD_LINK = "downloadLink";
@SerializedName(SERIALIZED_NAME_DOWNLOAD_LINK)
private String downloadLink;
public ExportLink() {
}
public ExportLink downloadLink(String downloadLink) {
this.downloadLink = downloadLink;
return this;
}
/**
* Get downloadLink
* @return downloadLink
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getDownloadLink() {
return downloadLink;
}
public void setDownloadLink(String downloadLink) {
this.downloadLink = downloadLink;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExportLink exportLink = (ExportLink) o;
return Objects.equals(this.downloadLink, exportLink.downloadLink);
}
@Override
public int hashCode() {
return Objects.hash(downloadLink);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExportLink {\n");
sb.append(" downloadLink: ").append(toIndentedString(downloadLink)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("downloadLink");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("downloadLink");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ExportLink
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ExportLink.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExportLink is not found in the empty JSON string", ExportLink.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ExportLink.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExportLink` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ExportLink.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("downloadLink").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `downloadLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadLink").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ExportLink.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExportLink' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ExportLink> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExportLink.class));
return (TypeAdapter<T>) new TypeAdapter<ExportLink>() {
@Override
public void write(JsonWriter out, ExportLink value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ExportLink read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ExportLink given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExportLink
* @throws IOException if the JSON string is invalid with respect to ExportLink
*/
public static ExportLink fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExportLink.class);
}
/**
* Convert an instance of ExportLink to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Record of inbox expiration
*/
@ApiModel(description = "Record of inbox expiration")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ExpiredInboxRecordProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public ExpiredInboxRecordProjection() {
}
public ExpiredInboxRecordProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ExpiredInboxRecordProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public ExpiredInboxRecordProjection emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public ExpiredInboxRecordProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExpiredInboxRecordProjection expiredInboxRecordProjection = (ExpiredInboxRecordProjection) o;
return Objects.equals(this.id, expiredInboxRecordProjection.id) &&
Objects.equals(this.userId, expiredInboxRecordProjection.userId) &&
Objects.equals(this.emailAddress, expiredInboxRecordProjection.emailAddress) &&
Objects.equals(this.createdAt, expiredInboxRecordProjection.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, emailAddress, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExpiredInboxRecordProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("emailAddress");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ExpiredInboxRecordProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ExpiredInboxRecordProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExpiredInboxRecordProjection is not found in the empty JSON string", ExpiredInboxRecordProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ExpiredInboxRecordProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExpiredInboxRecordProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ExpiredInboxRecordProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ExpiredInboxRecordProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExpiredInboxRecordProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ExpiredInboxRecordProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExpiredInboxRecordProjection.class));
return (TypeAdapter<T>) new TypeAdapter<ExpiredInboxRecordProjection>() {
@Override
public void write(JsonWriter out, ExpiredInboxRecordProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ExpiredInboxRecordProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ExpiredInboxRecordProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExpiredInboxRecordProjection
* @throws IOException if the JSON string is invalid with respect to ExpiredInboxRecordProjection
*/
public static ExpiredInboxRecordProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExpiredInboxRecordProjection.class);
}
/**
* Convert an instance of ExpiredInboxRecordProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Expired inbox
*/
@ApiModel(description = "Expired inbox")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ExpiredInboxDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public ExpiredInboxDto() {
}
public ExpiredInboxDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ExpiredInboxDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public ExpiredInboxDto emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExpiredInboxDto expiredInboxDto = (ExpiredInboxDto) o;
return Objects.equals(this.id, expiredInboxDto.id) &&
Objects.equals(this.inboxId, expiredInboxDto.inboxId) &&
Objects.equals(this.emailAddress, expiredInboxDto.emailAddress);
}
@Override
public int hashCode() {
return Objects.hash(id, inboxId, emailAddress);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExpiredInboxDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("emailAddress");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("emailAddress");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ExpiredInboxDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ExpiredInboxDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExpiredInboxDto is not found in the empty JSON string", ExpiredInboxDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ExpiredInboxDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExpiredInboxDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ExpiredInboxDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ExpiredInboxDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExpiredInboxDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ExpiredInboxDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExpiredInboxDto.class));
return (TypeAdapter<T>) new TypeAdapter<ExpiredInboxDto>() {
@Override
public void write(JsonWriter out, ExpiredInboxDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ExpiredInboxDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ExpiredInboxDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExpiredInboxDto
* @throws IOException if the JSON string is invalid with respect to ExpiredInboxDto
*/
public static ExpiredInboxDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExpiredInboxDto.class);
}
/**
* Convert an instance of ExpiredInboxDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Expiration defaults for your account
*/
@ApiModel(description = "Expiration defaults for your account")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ExpirationDefaults {
public static final String SERIALIZED_NAME_DEFAULT_EXPIRATION_MILLIS = "defaultExpirationMillis";
@SerializedName(SERIALIZED_NAME_DEFAULT_EXPIRATION_MILLIS)
private Long defaultExpirationMillis;
public static final String SERIALIZED_NAME_MAX_EXPIRATION_MILLIS = "maxExpirationMillis";
@SerializedName(SERIALIZED_NAME_MAX_EXPIRATION_MILLIS)
private Long maxExpirationMillis;
public static final String SERIALIZED_NAME_DEFAULT_EXPIRES_AT = "defaultExpiresAt";
@SerializedName(SERIALIZED_NAME_DEFAULT_EXPIRES_AT)
private OffsetDateTime defaultExpiresAt;
public static final String SERIALIZED_NAME_CAN_PERMANENT_INBOX = "canPermanentInbox";
@SerializedName(SERIALIZED_NAME_CAN_PERMANENT_INBOX)
private Boolean canPermanentInbox;
public static final String SERIALIZED_NAME_NEXT_INBOX_ALLOWS_PERMANENT = "nextInboxAllowsPermanent";
@SerializedName(SERIALIZED_NAME_NEXT_INBOX_ALLOWS_PERMANENT)
private Boolean nextInboxAllowsPermanent;
public ExpirationDefaults() {
}
public ExpirationDefaults defaultExpirationMillis(Long defaultExpirationMillis) {
this.defaultExpirationMillis = defaultExpirationMillis;
return this;
}
/**
* Get defaultExpirationMillis
* @return defaultExpirationMillis
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDefaultExpirationMillis() {
return defaultExpirationMillis;
}
public void setDefaultExpirationMillis(Long defaultExpirationMillis) {
this.defaultExpirationMillis = defaultExpirationMillis;
}
public ExpirationDefaults maxExpirationMillis(Long maxExpirationMillis) {
this.maxExpirationMillis = maxExpirationMillis;
return this;
}
/**
* Get maxExpirationMillis
* @return maxExpirationMillis
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getMaxExpirationMillis() {
return maxExpirationMillis;
}
public void setMaxExpirationMillis(Long maxExpirationMillis) {
this.maxExpirationMillis = maxExpirationMillis;
}
public ExpirationDefaults defaultExpiresAt(OffsetDateTime defaultExpiresAt) {
this.defaultExpiresAt = defaultExpiresAt;
return this;
}
/**
* Get defaultExpiresAt
* @return defaultExpiresAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getDefaultExpiresAt() {
return defaultExpiresAt;
}
public void setDefaultExpiresAt(OffsetDateTime defaultExpiresAt) {
this.defaultExpiresAt = defaultExpiresAt;
}
public ExpirationDefaults canPermanentInbox(Boolean canPermanentInbox) {
this.canPermanentInbox = canPermanentInbox;
return this;
}
/**
* Get canPermanentInbox
* @return canPermanentInbox
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getCanPermanentInbox() {
return canPermanentInbox;
}
public void setCanPermanentInbox(Boolean canPermanentInbox) {
this.canPermanentInbox = canPermanentInbox;
}
public ExpirationDefaults nextInboxAllowsPermanent(Boolean nextInboxAllowsPermanent) {
this.nextInboxAllowsPermanent = nextInboxAllowsPermanent;
return this;
}
/**
* Get nextInboxAllowsPermanent
* @return nextInboxAllowsPermanent
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getNextInboxAllowsPermanent() {
return nextInboxAllowsPermanent;
}
public void setNextInboxAllowsPermanent(Boolean nextInboxAllowsPermanent) {
this.nextInboxAllowsPermanent = nextInboxAllowsPermanent;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExpirationDefaults expirationDefaults = (ExpirationDefaults) o;
return Objects.equals(this.defaultExpirationMillis, expirationDefaults.defaultExpirationMillis) &&
Objects.equals(this.maxExpirationMillis, expirationDefaults.maxExpirationMillis) &&
Objects.equals(this.defaultExpiresAt, expirationDefaults.defaultExpiresAt) &&
Objects.equals(this.canPermanentInbox, expirationDefaults.canPermanentInbox) &&
Objects.equals(this.nextInboxAllowsPermanent, expirationDefaults.nextInboxAllowsPermanent);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(defaultExpirationMillis, maxExpirationMillis, defaultExpiresAt, canPermanentInbox, nextInboxAllowsPermanent);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExpirationDefaults {\n");
sb.append(" defaultExpirationMillis: ").append(toIndentedString(defaultExpirationMillis)).append("\n");
sb.append(" maxExpirationMillis: ").append(toIndentedString(maxExpirationMillis)).append("\n");
sb.append(" defaultExpiresAt: ").append(toIndentedString(defaultExpiresAt)).append("\n");
sb.append(" canPermanentInbox: ").append(toIndentedString(canPermanentInbox)).append("\n");
sb.append(" nextInboxAllowsPermanent: ").append(toIndentedString(nextInboxAllowsPermanent)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("defaultExpirationMillis");
openapiFields.add("maxExpirationMillis");
openapiFields.add("defaultExpiresAt");
openapiFields.add("canPermanentInbox");
openapiFields.add("nextInboxAllowsPermanent");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("canPermanentInbox");
openapiRequiredFields.add("nextInboxAllowsPermanent");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ExpirationDefaults
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ExpirationDefaults.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ExpirationDefaults is not found in the empty JSON string", ExpirationDefaults.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ExpirationDefaults.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExpirationDefaults` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ExpirationDefaults.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ExpirationDefaults.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ExpirationDefaults' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ExpirationDefaults> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ExpirationDefaults.class));
return (TypeAdapter<T>) new TypeAdapter<ExpirationDefaults>() {
@Override
public void write(JsonWriter out, ExpirationDefaults value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ExpirationDefaults read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ExpirationDefaults given an JSON string
*
* @param jsonString JSON string
* @return An instance of ExpirationDefaults
* @throws IOException if the JSON string is invalid with respect to ExpirationDefaults
*/
public static ExpirationDefaults fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ExpirationDefaults.class);
}
/**
* Convert an instance of ExpirationDefaults to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* EmptyResponseDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmptyResponseDto {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public EmptyResponseDto() {
}
public EmptyResponseDto message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmptyResponseDto emptyResponseDto = (EmptyResponseDto) o;
return Objects.equals(this.message, emptyResponseDto.message);
}
@Override
public int hashCode() {
return Objects.hash(message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmptyResponseDto {\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("message");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmptyResponseDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmptyResponseDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmptyResponseDto is not found in the empty JSON string", EmptyResponseDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmptyResponseDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmptyResponseDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmptyResponseDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmptyResponseDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmptyResponseDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmptyResponseDto.class));
return (TypeAdapter<T>) new TypeAdapter<EmptyResponseDto>() {
@Override
public void write(JsonWriter out, EmptyResponseDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmptyResponseDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmptyResponseDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmptyResponseDto
* @throws IOException if the JSON string is invalid with respect to EmptyResponseDto
*/
public static EmptyResponseDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmptyResponseDto.class);
}
/**
* Convert an instance of EmptyResponseDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* EmergencyAddressDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmergencyAddressDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_ADDRESS1 = "address1";
@SerializedName(SERIALIZED_NAME_ADDRESS1)
private String address1;
/**
* Gets or Sets phoneCountry
*/
@JsonAdapter(PhoneCountryEnum.Adapter.class)
public enum PhoneCountryEnum {
US("US"),
GB("GB"),
AU("AU");
private String value;
PhoneCountryEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PhoneCountryEnum fromValue(String value) {
for (PhoneCountryEnum b : PhoneCountryEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<PhoneCountryEnum> {
@Override
public void write(final JsonWriter jsonWriter, final PhoneCountryEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PhoneCountryEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PhoneCountryEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_PHONE_COUNTRY = "phoneCountry";
@SerializedName(SERIALIZED_NAME_PHONE_COUNTRY)
private PhoneCountryEnum phoneCountry;
public EmergencyAddressDto() {
}
public EmergencyAddressDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public EmergencyAddressDto address1(String address1) {
this.address1 = address1;
return this;
}
/**
* Get address1
* @return address1
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public EmergencyAddressDto phoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
return this;
}
/**
* Get phoneCountry
* @return phoneCountry
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public PhoneCountryEnum getPhoneCountry() {
return phoneCountry;
}
public void setPhoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmergencyAddressDto emergencyAddressDto = (EmergencyAddressDto) o;
return Objects.equals(this.id, emergencyAddressDto.id) &&
Objects.equals(this.address1, emergencyAddressDto.address1) &&
Objects.equals(this.phoneCountry, emergencyAddressDto.phoneCountry);
}
@Override
public int hashCode() {
return Objects.hash(id, address1, phoneCountry);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmergencyAddressDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" address1: ").append(toIndentedString(address1)).append("\n");
sb.append(" phoneCountry: ").append(toIndentedString(phoneCountry)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("address1");
openapiFields.add("phoneCountry");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("address1");
openapiRequiredFields.add("phoneCountry");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmergencyAddressDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmergencyAddressDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmergencyAddressDto is not found in the empty JSON string", EmergencyAddressDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmergencyAddressDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmergencyAddressDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmergencyAddressDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("address1").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address1").toString()));
}
if (!jsonObj.get("phoneCountry").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountry").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmergencyAddressDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmergencyAddressDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmergencyAddressDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmergencyAddressDto.class));
return (TypeAdapter<T>) new TypeAdapter<EmergencyAddressDto>() {
@Override
public void write(JsonWriter out, EmergencyAddressDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmergencyAddressDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmergencyAddressDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmergencyAddressDto
* @throws IOException if the JSON string is invalid with respect to EmergencyAddressDto
*/
public static EmergencyAddressDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmergencyAddressDto.class);
}
/**
* Convert an instance of EmergencyAddressDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* EmergencyAddress
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmergencyAddress {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_SID = "sid";
@SerializedName(SERIALIZED_NAME_SID)
private String sid;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName";
@SerializedName(SERIALIZED_NAME_DISPLAY_NAME)
private String displayName;
public static final String SERIALIZED_NAME_CUSTOMER_NAME = "customerName";
@SerializedName(SERIALIZED_NAME_CUSTOMER_NAME)
private String customerName;
public static final String SERIALIZED_NAME_ADDRESS1 = "address1";
@SerializedName(SERIALIZED_NAME_ADDRESS1)
private String address1;
public static final String SERIALIZED_NAME_CITY = "city";
@SerializedName(SERIALIZED_NAME_CITY)
private String city;
public static final String SERIALIZED_NAME_REGION = "region";
@SerializedName(SERIALIZED_NAME_REGION)
private String region;
public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode";
@SerializedName(SERIALIZED_NAME_POSTAL_CODE)
private String postalCode;
/**
* Gets or Sets phoneCountry
*/
@JsonAdapter(PhoneCountryEnum.Adapter.class)
public enum PhoneCountryEnum {
US("US"),
GB("GB"),
AU("AU");
private String value;
PhoneCountryEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PhoneCountryEnum fromValue(String value) {
for (PhoneCountryEnum b : PhoneCountryEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<PhoneCountryEnum> {
@Override
public void write(final JsonWriter jsonWriter, final PhoneCountryEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PhoneCountryEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PhoneCountryEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_PHONE_COUNTRY = "phoneCountry";
@SerializedName(SERIALIZED_NAME_PHONE_COUNTRY)
private PhoneCountryEnum phoneCountry;
public static final String SERIALIZED_NAME_ACCOUNT_SID = "accountSid";
@SerializedName(SERIALIZED_NAME_ACCOUNT_SID)
private String accountSid;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public EmergencyAddress() {
}
public EmergencyAddress id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public EmergencyAddress sid(String sid) {
this.sid = sid;
return this;
}
/**
* Get sid
* @return sid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getSid() {
return sid;
}
public void setSid(String sid) {
this.sid = sid;
}
public EmergencyAddress userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public EmergencyAddress displayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* Get displayName
* @return displayName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public EmergencyAddress customerName(String customerName) {
this.customerName = customerName;
return this;
}
/**
* Get customerName
* @return customerName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public EmergencyAddress address1(String address1) {
this.address1 = address1;
return this;
}
/**
* Get address1
* @return address1
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public EmergencyAddress city(String city) {
this.city = city;
return this;
}
/**
* Get city
* @return city
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public EmergencyAddress region(String region) {
this.region = region;
return this;
}
/**
* Get region
* @return region
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public EmergencyAddress postalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/**
* Get postalCode
* @return postalCode
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public EmergencyAddress phoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
return this;
}
/**
* Get phoneCountry
* @return phoneCountry
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public PhoneCountryEnum getPhoneCountry() {
return phoneCountry;
}
public void setPhoneCountry(PhoneCountryEnum phoneCountry) {
this.phoneCountry = phoneCountry;
}
public EmergencyAddress accountSid(String accountSid) {
this.accountSid = accountSid;
return this;
}
/**
* Get accountSid
* @return accountSid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getAccountSid() {
return accountSid;
}
public void setAccountSid(String accountSid) {
this.accountSid = accountSid;
}
public EmergencyAddress createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public EmergencyAddress updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmergencyAddress emergencyAddress = (EmergencyAddress) o;
return Objects.equals(this.id, emergencyAddress.id) &&
Objects.equals(this.sid, emergencyAddress.sid) &&
Objects.equals(this.userId, emergencyAddress.userId) &&
Objects.equals(this.displayName, emergencyAddress.displayName) &&
Objects.equals(this.customerName, emergencyAddress.customerName) &&
Objects.equals(this.address1, emergencyAddress.address1) &&
Objects.equals(this.city, emergencyAddress.city) &&
Objects.equals(this.region, emergencyAddress.region) &&
Objects.equals(this.postalCode, emergencyAddress.postalCode) &&
Objects.equals(this.phoneCountry, emergencyAddress.phoneCountry) &&
Objects.equals(this.accountSid, emergencyAddress.accountSid) &&
Objects.equals(this.createdAt, emergencyAddress.createdAt) &&
Objects.equals(this.updatedAt, emergencyAddress.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, sid, userId, displayName, customerName, address1, city, region, postalCode, phoneCountry, accountSid, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmergencyAddress {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" sid: ").append(toIndentedString(sid)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
sb.append(" customerName: ").append(toIndentedString(customerName)).append("\n");
sb.append(" address1: ").append(toIndentedString(address1)).append("\n");
sb.append(" city: ").append(toIndentedString(city)).append("\n");
sb.append(" region: ").append(toIndentedString(region)).append("\n");
sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n");
sb.append(" phoneCountry: ").append(toIndentedString(phoneCountry)).append("\n");
sb.append(" accountSid: ").append(toIndentedString(accountSid)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("sid");
openapiFields.add("userId");
openapiFields.add("displayName");
openapiFields.add("customerName");
openapiFields.add("address1");
openapiFields.add("city");
openapiFields.add("region");
openapiFields.add("postalCode");
openapiFields.add("phoneCountry");
openapiFields.add("accountSid");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("sid");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("displayName");
openapiRequiredFields.add("customerName");
openapiRequiredFields.add("address1");
openapiRequiredFields.add("city");
openapiRequiredFields.add("region");
openapiRequiredFields.add("postalCode");
openapiRequiredFields.add("phoneCountry");
openapiRequiredFields.add("accountSid");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmergencyAddress
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmergencyAddress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmergencyAddress is not found in the empty JSON string", EmergencyAddress.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmergencyAddress.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmergencyAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmergencyAddress.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("sid").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sid").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("displayName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString()));
}
if (!jsonObj.get("customerName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `customerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerName").toString()));
}
if (!jsonObj.get("address1").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address1").toString()));
}
if (!jsonObj.get("city").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString()));
}
if (!jsonObj.get("region").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString()));
}
if (!jsonObj.get("postalCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postalCode").toString()));
}
if (!jsonObj.get("phoneCountry").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `phoneCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountry").toString()));
}
if (!jsonObj.get("accountSid").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accountSid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountSid").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmergencyAddress.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmergencyAddress' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmergencyAddress> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmergencyAddress.class));
return (TypeAdapter<T>) new TypeAdapter<EmergencyAddress>() {
@Override
public void write(JsonWriter out, EmergencyAddress value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmergencyAddress read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmergencyAddress given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmergencyAddress
* @throws IOException if the JSON string is invalid with respect to EmergencyAddress
*/
public static EmergencyAddress fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmergencyAddress.class);
}
/**
* Convert an instance of EmergencyAddress to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email verification result. Valid means email address exists according to response from mail server running at the domain and port given.
*/
@ApiModel(description = "Email verification result. Valid means email address exists according to response from mail server running at the domain and port given.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailVerificationResult {
public static final String SERIALIZED_NAME_DOMAIN_NAME = "domainName";
@SerializedName(SERIALIZED_NAME_DOMAIN_NAME)
private String domainName;
public static final String SERIALIZED_NAME_PORT = "port";
@SerializedName(SERIALIZED_NAME_PORT)
private Integer port;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_IS_VALID = "isValid";
@SerializedName(SERIALIZED_NAME_IS_VALID)
private Boolean isValid;
public static final String SERIALIZED_NAME_ERROR = "error";
@SerializedName(SERIALIZED_NAME_ERROR)
private String error;
public EmailVerificationResult() {
}
public EmailVerificationResult domainName(String domainName) {
this.domainName = domainName;
return this;
}
/**
* Get domainName
* @return domainName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getDomainName() {
return domainName;
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public EmailVerificationResult port(Integer port) {
this.port = port;
return this;
}
/**
* Get port
* @return port
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public EmailVerificationResult emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public EmailVerificationResult isValid(Boolean isValid) {
this.isValid = isValid;
return this;
}
/**
* Get isValid
* @return isValid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getIsValid() {
return isValid;
}
public void setIsValid(Boolean isValid) {
this.isValid = isValid;
}
public EmailVerificationResult error(String error) {
this.error = error;
return this;
}
/**
* Get error
* @return error
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailVerificationResult emailVerificationResult = (EmailVerificationResult) o;
return Objects.equals(this.domainName, emailVerificationResult.domainName) &&
Objects.equals(this.port, emailVerificationResult.port) &&
Objects.equals(this.emailAddress, emailVerificationResult.emailAddress) &&
Objects.equals(this.isValid, emailVerificationResult.isValid) &&
Objects.equals(this.error, emailVerificationResult.error);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(domainName, port, emailAddress, isValid, error);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailVerificationResult {\n");
sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n");
sb.append(" port: ").append(toIndentedString(port)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n");
sb.append(" error: ").append(toIndentedString(error)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("domainName");
openapiFields.add("port");
openapiFields.add("emailAddress");
openapiFields.add("isValid");
openapiFields.add("error");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("domainName");
openapiRequiredFields.add("port");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("isValid");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailVerificationResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailVerificationResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailVerificationResult is not found in the empty JSON string", EmailVerificationResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailVerificationResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailVerificationResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailVerificationResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("domainName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainName").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailVerificationResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailVerificationResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailVerificationResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailVerificationResult.class));
return (TypeAdapter<T>) new TypeAdapter<EmailVerificationResult>() {
@Override
public void write(JsonWriter out, EmailVerificationResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailVerificationResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailVerificationResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailVerificationResult
* @throws IOException if the JSON string is invalid with respect to EmailVerificationResult
*/
public static EmailVerificationResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailVerificationResult.class);
}
/**
* Convert an instance of EmailVerificationResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email validation request
*/
@ApiModel(description = "Email validation request")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailValidationRequestDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_IS_VALID = "isValid";
@SerializedName(SERIALIZED_NAME_IS_VALID)
private Boolean isValid;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public EmailValidationRequestDto() {
}
public EmailValidationRequestDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public EmailValidationRequestDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public EmailValidationRequestDto emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public EmailValidationRequestDto isValid(Boolean isValid) {
this.isValid = isValid;
return this;
}
/**
* Get isValid
* @return isValid
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getIsValid() {
return isValid;
}
public void setIsValid(Boolean isValid) {
this.isValid = isValid;
}
public EmailValidationRequestDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public EmailValidationRequestDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailValidationRequestDto emailValidationRequestDto = (EmailValidationRequestDto) o;
return Objects.equals(this.id, emailValidationRequestDto.id) &&
Objects.equals(this.userId, emailValidationRequestDto.userId) &&
Objects.equals(this.emailAddress, emailValidationRequestDto.emailAddress) &&
Objects.equals(this.isValid, emailValidationRequestDto.isValid) &&
Objects.equals(this.createdAt, emailValidationRequestDto.createdAt) &&
Objects.equals(this.updatedAt, emailValidationRequestDto.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, emailAddress, isValid, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailValidationRequestDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("emailAddress");
openapiFields.add("isValid");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("isValid");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailValidationRequestDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailValidationRequestDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailValidationRequestDto is not found in the empty JSON string", EmailValidationRequestDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailValidationRequestDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailValidationRequestDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailValidationRequestDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailValidationRequestDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailValidationRequestDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailValidationRequestDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailValidationRequestDto.class));
return (TypeAdapter<T>) new TypeAdapter<EmailValidationRequestDto>() {
@Override
public void write(JsonWriter out, EmailValidationRequestDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailValidationRequestDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailValidationRequestDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailValidationRequestDto
* @throws IOException if the JSON string is invalid with respect to EmailValidationRequestDto
*/
public static EmailValidationRequestDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailValidationRequestDto.class);
}
/**
* Convert an instance of EmailValidationRequestDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Parsed text of an email
*/
@ApiModel(description = "Parsed text of an email")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailTextLinesResult {
public static final String SERIALIZED_NAME_LINES = "lines";
@SerializedName(SERIALIZED_NAME_LINES)
private List<String> lines = new ArrayList<>();
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public EmailTextLinesResult() {
}
public EmailTextLinesResult lines(List<String> lines) {
this.lines = lines;
return this;
}
public EmailTextLinesResult addLinesItem(String linesItem) {
this.lines.add(linesItem);
return this;
}
/**
* Get lines
* @return lines
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getLines() {
return lines;
}
public void setLines(List<String> lines) {
this.lines = lines;
}
public EmailTextLinesResult body(String body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailTextLinesResult emailTextLinesResult = (EmailTextLinesResult) o;
return Objects.equals(this.lines, emailTextLinesResult.lines) &&
Objects.equals(this.body, emailTextLinesResult.body);
}
@Override
public int hashCode() {
return Objects.hash(lines, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailTextLinesResult {\n");
sb.append(" lines: ").append(toIndentedString(lines)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("lines");
openapiFields.add("body");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("lines");
openapiRequiredFields.add("body");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailTextLinesResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailTextLinesResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTextLinesResult is not found in the empty JSON string", EmailTextLinesResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailTextLinesResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTextLinesResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailTextLinesResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("lines") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("lines").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `lines` to be an array in the JSON string but got `%s`", jsonObj.get("lines").toString()));
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailTextLinesResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailTextLinesResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailTextLinesResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailTextLinesResult.class));
return (TypeAdapter<T>) new TypeAdapter<EmailTextLinesResult>() {
@Override
public void write(JsonWriter out, EmailTextLinesResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailTextLinesResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailTextLinesResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailTextLinesResult
* @throws IOException if the JSON string is invalid with respect to EmailTextLinesResult
*/
public static EmailTextLinesResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailTextLinesResult.class);
}
/**
* Convert an instance of EmailTextLinesResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.Recipient;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* The `To`,`CC`,`BCC` recipients stored in object form with email address and name accessible.
*/
@ApiModel(description = "The `To`,`CC`,`BCC` recipients stored in object form with email address and name accessible.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailRecipients {
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<Recipient> to = null;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<Recipient> cc = null;
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<Recipient> bcc = null;
public EmailRecipients() {
}
public EmailRecipients to(List<Recipient> to) {
this.to = to;
return this;
}
public EmailRecipients addToItem(Recipient toItem) {
if (this.to == null) {
this.to = new ArrayList<>();
}
this.to.add(toItem);
return this;
}
/**
* Get to
* @return to
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<Recipient> getTo() {
return to;
}
public void setTo(List<Recipient> to) {
this.to = to;
}
public EmailRecipients cc(List<Recipient> cc) {
this.cc = cc;
return this;
}
public EmailRecipients addCcItem(Recipient ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* Get cc
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<Recipient> getCc() {
return cc;
}
public void setCc(List<Recipient> cc) {
this.cc = cc;
}
public EmailRecipients bcc(List<Recipient> bcc) {
this.bcc = bcc;
return this;
}
public EmailRecipients addBccItem(Recipient bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* Get bcc
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<Recipient> getBcc() {
return bcc;
}
public void setBcc(List<Recipient> bcc) {
this.bcc = bcc;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailRecipients emailRecipients = (EmailRecipients) o;
return Objects.equals(this.to, emailRecipients.to) &&
Objects.equals(this.cc, emailRecipients.cc) &&
Objects.equals(this.bcc, emailRecipients.bcc);
}
@Override
public int hashCode() {
return Objects.hash(to, cc, bcc);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailRecipients {\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("to");
openapiFields.add("cc");
openapiFields.add("bcc");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailRecipients
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailRecipients.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailRecipients is not found in the empty JSON string", EmailRecipients.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailRecipients.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailRecipients` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) {
JsonArray jsonArrayto = jsonObj.getAsJsonArray("to");
if (jsonArrayto != null) {
// ensure the json data is an array
if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
// validate the optional field `to` (array)
for (int i = 0; i < jsonArrayto.size(); i++) {
Recipient.validateJsonObject(jsonArrayto.get(i).getAsJsonObject());
};
}
}
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonNull()) {
JsonArray jsonArraycc = jsonObj.getAsJsonArray("cc");
if (jsonArraycc != null) {
// ensure the json data is an array
if (!jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// validate the optional field `cc` (array)
for (int i = 0; i < jsonArraycc.size(); i++) {
Recipient.validateJsonObject(jsonArraycc.get(i).getAsJsonObject());
};
}
}
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonNull()) {
JsonArray jsonArraybcc = jsonObj.getAsJsonArray("bcc");
if (jsonArraybcc != null) {
// ensure the json data is an array
if (!jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// validate the optional field `bcc` (array)
for (int i = 0; i < jsonArraybcc.size(); i++) {
Recipient.validateJsonObject(jsonArraybcc.get(i).getAsJsonObject());
};
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailRecipients.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailRecipients' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailRecipients> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailRecipients.class));
return (TypeAdapter<T>) new TypeAdapter<EmailRecipients>() {
@Override
public void write(JsonWriter out, EmailRecipients value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailRecipients read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailRecipients given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailRecipients
* @throws IOException if the JSON string is invalid with respect to EmailRecipients
*/
public static EmailRecipients fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailRecipients.class);
}
/**
* Convert an instance of EmailRecipients to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* A compact representation of a full email. Used in list endpoints to keep response sizes low. Body and attachments are not included. To get all fields of the email use the `getEmail` method with the email projection's ID. See `EmailDto` for documentation on projection properties.
*/
@ApiModel(description = "A compact representation of a full email. Used in list endpoints to keep response sizes low. Body and attachments are not included. To get all fields of the email use the `getEmail` method with the email projection's ID. See `EmailDto` for documentation on projection properties.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_READ = "read";
@SerializedName(SERIALIZED_NAME_READ)
private Boolean read;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_BODY_EXCERPT = "bodyExcerpt";
@SerializedName(SERIALIZED_NAME_BODY_EXCERPT)
private String bodyExcerpt;
public static final String SERIALIZED_NAME_TEAM_ACCESS = "teamAccess";
@SerializedName(SERIALIZED_NAME_TEAM_ACCESS)
private Boolean teamAccess;
public static final String SERIALIZED_NAME_BODY_M_D5_HASH = "bodyMD5Hash";
@SerializedName(SERIALIZED_NAME_BODY_M_D5_HASH)
private String bodyMD5Hash;
public EmailProjection() {
}
public EmailProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public EmailProjection from(String from) {
this.from = from;
return this;
}
/**
* Get from
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public EmailProjection subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public EmailProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public EmailProjection attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public EmailProjection addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* Get attachments
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public EmailProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public EmailProjection to(List<String> to) {
this.to = to;
return this;
}
public EmailProjection addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* Get to
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public EmailProjection bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public EmailProjection addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* Get bcc
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public EmailProjection cc(List<String> cc) {
this.cc = cc;
return this;
}
public EmailProjection addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* Get cc
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public EmailProjection read(Boolean read) {
this.read = read;
return this;
}
/**
* Get read
* @return read
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getRead() {
return read;
}
public void setRead(Boolean read) {
this.read = read;
}
public EmailProjection domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* Get domainId
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public EmailProjection bodyExcerpt(String bodyExcerpt) {
this.bodyExcerpt = bodyExcerpt;
return this;
}
/**
* Get bodyExcerpt
* @return bodyExcerpt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBodyExcerpt() {
return bodyExcerpt;
}
public void setBodyExcerpt(String bodyExcerpt) {
this.bodyExcerpt = bodyExcerpt;
}
public EmailProjection teamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
return this;
}
/**
* Get teamAccess
* @return teamAccess
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getTeamAccess() {
return teamAccess;
}
public void setTeamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
}
public EmailProjection bodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
return this;
}
/**
* Get bodyMD5Hash
* @return bodyMD5Hash
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBodyMD5Hash() {
return bodyMD5Hash;
}
public void setBodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailProjection emailProjection = (EmailProjection) o;
return Objects.equals(this.id, emailProjection.id) &&
Objects.equals(this.from, emailProjection.from) &&
Objects.equals(this.subject, emailProjection.subject) &&
Objects.equals(this.inboxId, emailProjection.inboxId) &&
Objects.equals(this.attachments, emailProjection.attachments) &&
Objects.equals(this.createdAt, emailProjection.createdAt) &&
Objects.equals(this.to, emailProjection.to) &&
Objects.equals(this.bcc, emailProjection.bcc) &&
Objects.equals(this.cc, emailProjection.cc) &&
Objects.equals(this.read, emailProjection.read) &&
Objects.equals(this.domainId, emailProjection.domainId) &&
Objects.equals(this.bodyExcerpt, emailProjection.bodyExcerpt) &&
Objects.equals(this.teamAccess, emailProjection.teamAccess) &&
Objects.equals(this.bodyMD5Hash, emailProjection.bodyMD5Hash);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, from, subject, inboxId, attachments, createdAt, to, bcc, cc, read, domainId, bodyExcerpt, teamAccess, bodyMD5Hash);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" read: ").append(toIndentedString(read)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" bodyExcerpt: ").append(toIndentedString(bodyExcerpt)).append("\n");
sb.append(" teamAccess: ").append(toIndentedString(teamAccess)).append("\n");
sb.append(" bodyMD5Hash: ").append(toIndentedString(bodyMD5Hash)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("from");
openapiFields.add("subject");
openapiFields.add("inboxId");
openapiFields.add("attachments");
openapiFields.add("createdAt");
openapiFields.add("to");
openapiFields.add("bcc");
openapiFields.add("cc");
openapiFields.add("read");
openapiFields.add("domainId");
openapiFields.add("bodyExcerpt");
openapiFields.add("teamAccess");
openapiFields.add("bodyMD5Hash");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("to");
openapiRequiredFields.add("read");
openapiRequiredFields.add("teamAccess");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailProjection is not found in the empty JSON string", EmailProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if ((jsonObj.get("bodyExcerpt") != null && !jsonObj.get("bodyExcerpt").isJsonNull()) && !jsonObj.get("bodyExcerpt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyExcerpt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyExcerpt").toString()));
}
if ((jsonObj.get("bodyMD5Hash") != null && !jsonObj.get("bodyMD5Hash").isJsonNull()) && !jsonObj.get("bodyMD5Hash").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyMD5Hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyMD5Hash").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailProjection.class));
return (TypeAdapter<T>) new TypeAdapter<EmailProjection>() {
@Override
public void write(JsonWriter out, EmailProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailProjection
* @throws IOException if the JSON string is invalid with respect to EmailProjection
*/
public static EmailProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailProjection.class);
}
/**
* Convert an instance of EmailProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* URLs for email body
*/
@ApiModel(description = "URLs for email body")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailPreviewUrls {
public static final String SERIALIZED_NAME_RAW_SMTP_MESSAGE_URL = "rawSmtpMessageUrl";
@SerializedName(SERIALIZED_NAME_RAW_SMTP_MESSAGE_URL)
private String rawSmtpMessageUrl;
public static final String SERIALIZED_NAME_PLAIN_HTML_BODY_URL = "plainHtmlBodyUrl";
@SerializedName(SERIALIZED_NAME_PLAIN_HTML_BODY_URL)
private String plainHtmlBodyUrl;
public EmailPreviewUrls() {
}
public EmailPreviewUrls rawSmtpMessageUrl(String rawSmtpMessageUrl) {
this.rawSmtpMessageUrl = rawSmtpMessageUrl;
return this;
}
/**
* Get rawSmtpMessageUrl
* @return rawSmtpMessageUrl
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRawSmtpMessageUrl() {
return rawSmtpMessageUrl;
}
public void setRawSmtpMessageUrl(String rawSmtpMessageUrl) {
this.rawSmtpMessageUrl = rawSmtpMessageUrl;
}
public EmailPreviewUrls plainHtmlBodyUrl(String plainHtmlBodyUrl) {
this.plainHtmlBodyUrl = plainHtmlBodyUrl;
return this;
}
/**
* Get plainHtmlBodyUrl
* @return plainHtmlBodyUrl
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPlainHtmlBodyUrl() {
return plainHtmlBodyUrl;
}
public void setPlainHtmlBodyUrl(String plainHtmlBodyUrl) {
this.plainHtmlBodyUrl = plainHtmlBodyUrl;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailPreviewUrls emailPreviewUrls = (EmailPreviewUrls) o;
return Objects.equals(this.rawSmtpMessageUrl, emailPreviewUrls.rawSmtpMessageUrl) &&
Objects.equals(this.plainHtmlBodyUrl, emailPreviewUrls.plainHtmlBodyUrl);
}
@Override
public int hashCode() {
return Objects.hash(rawSmtpMessageUrl, plainHtmlBodyUrl);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailPreviewUrls {\n");
sb.append(" rawSmtpMessageUrl: ").append(toIndentedString(rawSmtpMessageUrl)).append("\n");
sb.append(" plainHtmlBodyUrl: ").append(toIndentedString(plainHtmlBodyUrl)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("rawSmtpMessageUrl");
openapiFields.add("plainHtmlBodyUrl");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("rawSmtpMessageUrl");
openapiRequiredFields.add("plainHtmlBodyUrl");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailPreviewUrls
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailPreviewUrls.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailPreviewUrls is not found in the empty JSON string", EmailPreviewUrls.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailPreviewUrls.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailPreviewUrls` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailPreviewUrls.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("rawSmtpMessageUrl").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `rawSmtpMessageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawSmtpMessageUrl").toString()));
}
if (!jsonObj.get("plainHtmlBodyUrl").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `plainHtmlBodyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plainHtmlBodyUrl").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailPreviewUrls.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailPreviewUrls' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailPreviewUrls> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailPreviewUrls.class));
return (TypeAdapter<T>) new TypeAdapter<EmailPreviewUrls>() {
@Override
public void write(JsonWriter out, EmailPreviewUrls value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailPreviewUrls read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailPreviewUrls given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailPreviewUrls
* @throws IOException if the JSON string is invalid with respect to EmailPreviewUrls
*/
public static EmailPreviewUrls fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailPreviewUrls.class);
}
/**
* Convert an instance of EmailPreviewUrls to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Preview of an email message. For full message (including body and attachments) call the `getEmail` or other email endpoints with the provided email ID.
*/
@ApiModel(description = "Preview of an email message. For full message (including body and attachments) call the `getEmail` or other email endpoints with the provided email ID.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailPreview {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_READ = "read";
@SerializedName(SERIALIZED_NAME_READ)
private Boolean read;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public EmailPreview() {
}
public EmailPreview id(UUID id) {
this.id = id;
return this;
}
/**
* ID of the email entity
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the email entity")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public EmailPreview domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* ID of the domain that received the email
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of the domain that received the email")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public EmailPreview subject(String subject) {
this.subject = subject;
return this;
}
/**
* The subject line of the email message as specified by SMTP subject header
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The subject line of the email message as specified by SMTP subject header")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public EmailPreview to(List<String> to) {
this.to = to;
return this;
}
public EmailPreview addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* List of `To` recipient email addresses that the email was addressed to. See recipients object for names.
* @return to
**/
@javax.annotation.Nullable
@ApiModelProperty(required = true, value = "List of `To` recipient email addresses that the email was addressed to. See recipients object for names.")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public EmailPreview from(String from) {
this.from = from;
return this;
}
/**
* Who the email was sent from. An email address - see fromName for the sender name.
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Who the email was sent from. An email address - see fromName for the sender name.")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public EmailPreview bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public EmailPreview addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public EmailPreview cc(List<String> cc) {
this.cc = cc;
return this;
}
public EmailPreview addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public EmailPreview createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* When was the email received by MailSlurp
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "When was the email received by MailSlurp")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public EmailPreview read(Boolean read) {
this.read = read;
return this;
}
/**
* Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks.
* @return read
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks.")
public Boolean getRead() {
return read;
}
public void setRead(Boolean read) {
this.read = read;
}
public EmailPreview attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public EmailPreview addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailPreview emailPreview = (EmailPreview) o;
return Objects.equals(this.id, emailPreview.id) &&
Objects.equals(this.domainId, emailPreview.domainId) &&
Objects.equals(this.subject, emailPreview.subject) &&
Objects.equals(this.to, emailPreview.to) &&
Objects.equals(this.from, emailPreview.from) &&
Objects.equals(this.bcc, emailPreview.bcc) &&
Objects.equals(this.cc, emailPreview.cc) &&
Objects.equals(this.createdAt, emailPreview.createdAt) &&
Objects.equals(this.read, emailPreview.read) &&
Objects.equals(this.attachments, emailPreview.attachments);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, domainId, subject, to, from, bcc, cc, createdAt, read, attachments);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailPreview {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" read: ").append(toIndentedString(read)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("domainId");
openapiFields.add("subject");
openapiFields.add("to");
openapiFields.add("from");
openapiFields.add("bcc");
openapiFields.add("cc");
openapiFields.add("createdAt");
openapiFields.add("read");
openapiFields.add("attachments");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("to");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("read");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailPreview
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailPreview.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailPreview is not found in the empty JSON string", EmailPreview.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailPreview.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailPreview` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailPreview.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailPreview.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailPreview' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailPreview> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailPreview.class));
return (TypeAdapter<T>) new TypeAdapter<EmailPreview>() {
@Override
public void write(JsonWriter out, EmailPreview value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailPreview read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailPreview given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailPreview
* @throws IOException if the JSON string is invalid with respect to EmailPreview
*/
public static EmailPreview fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailPreview.class);
}
/**
* Convert an instance of EmailPreview to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Links found in HTML
*/
@ApiModel(description = "Links found in HTML")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailLinksResult {
public static final String SERIALIZED_NAME_LINKS = "links";
@SerializedName(SERIALIZED_NAME_LINKS)
private List<String> links = new ArrayList<>();
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public EmailLinksResult() {
}
public EmailLinksResult links(List<String> links) {
this.links = links;
return this;
}
public EmailLinksResult addLinksItem(String linksItem) {
this.links.add(linksItem);
return this;
}
/**
* Get links
* @return links
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getLinks() {
return links;
}
public void setLinks(List<String> links) {
this.links = links;
}
public EmailLinksResult body(String body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailLinksResult emailLinksResult = (EmailLinksResult) o;
return Objects.equals(this.links, emailLinksResult.links) &&
Objects.equals(this.body, emailLinksResult.body);
}
@Override
public int hashCode() {
return Objects.hash(links, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailLinksResult {\n");
sb.append(" links: ").append(toIndentedString(links)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("links");
openapiFields.add("body");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("links");
openapiRequiredFields.add("body");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailLinksResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailLinksResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinksResult is not found in the empty JSON string", EmailLinksResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailLinksResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinksResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailLinksResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("links") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("links").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString()));
}
if (!jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailLinksResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailLinksResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailLinksResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailLinksResult.class));
return (TypeAdapter<T>) new TypeAdapter<EmailLinksResult>() {
@Override
public void write(JsonWriter out, EmailLinksResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailLinksResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailLinksResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailLinksResult
* @throws IOException if the JSON string is invalid with respect to EmailLinksResult
*/
public static EmailLinksResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailLinksResult.class);
}
/**
* Convert an instance of EmailLinksResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* EmailHtmlDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailHtmlDto {
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public EmailHtmlDto() {
}
public EmailHtmlDto subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public EmailHtmlDto body(String body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailHtmlDto emailHtmlDto = (EmailHtmlDto) o;
return Objects.equals(this.subject, emailHtmlDto.subject) &&
Objects.equals(this.body, emailHtmlDto.body);
}
@Override
public int hashCode() {
return Objects.hash(subject, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailHtmlDto {\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("subject");
openapiFields.add("body");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailHtmlDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailHtmlDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailHtmlDto is not found in the empty JSON string", EmailHtmlDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailHtmlDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailHtmlDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailHtmlDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailHtmlDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailHtmlDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailHtmlDto.class));
return (TypeAdapter<T>) new TypeAdapter<EmailHtmlDto>() {
@Override
public void write(JsonWriter out, EmailHtmlDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailHtmlDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailHtmlDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailHtmlDto
* @throws IOException if the JSON string is invalid with respect to EmailHtmlDto
*/
public static EmailHtmlDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailHtmlDto.class);
}
/**
* Convert an instance of EmailHtmlDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Matches for the given pattern
*/
@ApiModel(description = "Matches for the given pattern")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailContentMatchResult {
public static final String SERIALIZED_NAME_PATTERN = "pattern";
@SerializedName(SERIALIZED_NAME_PATTERN)
private String pattern;
public static final String SERIALIZED_NAME_MATCHES = "matches";
@SerializedName(SERIALIZED_NAME_MATCHES)
private List<String> matches = new ArrayList<>();
public EmailContentMatchResult() {
}
public EmailContentMatchResult pattern(String pattern) {
this.pattern = pattern;
return this;
}
/**
* Get pattern
* @return pattern
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public EmailContentMatchResult matches(List<String> matches) {
this.matches = matches;
return this;
}
public EmailContentMatchResult addMatchesItem(String matchesItem) {
this.matches.add(matchesItem);
return this;
}
/**
* Get matches
* @return matches
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getMatches() {
return matches;
}
public void setMatches(List<String> matches) {
this.matches = matches;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailContentMatchResult emailContentMatchResult = (EmailContentMatchResult) o;
return Objects.equals(this.pattern, emailContentMatchResult.pattern) &&
Objects.equals(this.matches, emailContentMatchResult.matches);
}
@Override
public int hashCode() {
return Objects.hash(pattern, matches);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailContentMatchResult {\n");
sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n");
sb.append(" matches: ").append(toIndentedString(matches)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("pattern");
openapiFields.add("matches");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("pattern");
openapiRequiredFields.add("matches");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailContentMatchResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailContentMatchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailContentMatchResult is not found in the empty JSON string", EmailContentMatchResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailContentMatchResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailContentMatchResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : EmailContentMatchResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("pattern").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `pattern` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pattern").toString()));
}
// ensure the required json array is present
if (jsonObj.get("matches") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("matches").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `matches` to be an array in the JSON string but got `%s`", jsonObj.get("matches").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailContentMatchResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailContentMatchResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailContentMatchResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailContentMatchResult.class));
return (TypeAdapter<T>) new TypeAdapter<EmailContentMatchResult>() {
@Override
public void write(JsonWriter out, EmailContentMatchResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailContentMatchResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailContentMatchResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailContentMatchResult
* @throws IOException if the JSON string is invalid with respect to EmailContentMatchResult
*/
public static EmailContentMatchResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailContentMatchResult.class);
}
/**
* Convert an instance of EmailContentMatchResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Analysis result for email. Each verdict property is a string PASS|FAIL|GRAY or dynamic error message
*/
@ApiModel(description = "Analysis result for email. Each verdict property is a string PASS|FAIL|GRAY or dynamic error message")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class EmailAnalysis {
public static final String SERIALIZED_NAME_SPAM_VERDICT = "spamVerdict";
@SerializedName(SERIALIZED_NAME_SPAM_VERDICT)
private String spamVerdict;
public static final String SERIALIZED_NAME_VIRUS_VERDICT = "virusVerdict";
@SerializedName(SERIALIZED_NAME_VIRUS_VERDICT)
private String virusVerdict;
public static final String SERIALIZED_NAME_SPF_VERDICT = "spfVerdict";
@SerializedName(SERIALIZED_NAME_SPF_VERDICT)
private String spfVerdict;
public static final String SERIALIZED_NAME_DKIM_VERDICT = "dkimVerdict";
@SerializedName(SERIALIZED_NAME_DKIM_VERDICT)
private String dkimVerdict;
public static final String SERIALIZED_NAME_DMARC_VERDICT = "dmarcVerdict";
@SerializedName(SERIALIZED_NAME_DMARC_VERDICT)
private String dmarcVerdict;
public EmailAnalysis() {
}
public EmailAnalysis spamVerdict(String spamVerdict) {
this.spamVerdict = spamVerdict;
return this;
}
/**
* Verdict of spam ranking analysis
* @return spamVerdict
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Verdict of spam ranking analysis")
public String getSpamVerdict() {
return spamVerdict;
}
public void setSpamVerdict(String spamVerdict) {
this.spamVerdict = spamVerdict;
}
public EmailAnalysis virusVerdict(String virusVerdict) {
this.virusVerdict = virusVerdict;
return this;
}
/**
* Verdict of virus scan analysis
* @return virusVerdict
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Verdict of virus scan analysis")
public String getVirusVerdict() {
return virusVerdict;
}
public void setVirusVerdict(String virusVerdict) {
this.virusVerdict = virusVerdict;
}
public EmailAnalysis spfVerdict(String spfVerdict) {
this.spfVerdict = spfVerdict;
return this;
}
/**
* Verdict of Send Policy Framework record spoofing analysis
* @return spfVerdict
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Verdict of Send Policy Framework record spoofing analysis")
public String getSpfVerdict() {
return spfVerdict;
}
public void setSpfVerdict(String spfVerdict) {
this.spfVerdict = spfVerdict;
}
public EmailAnalysis dkimVerdict(String dkimVerdict) {
this.dkimVerdict = dkimVerdict;
return this;
}
/**
* Verdict of DomainKeys Identified Mail analysis
* @return dkimVerdict
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Verdict of DomainKeys Identified Mail analysis")
public String getDkimVerdict() {
return dkimVerdict;
}
public void setDkimVerdict(String dkimVerdict) {
this.dkimVerdict = dkimVerdict;
}
public EmailAnalysis dmarcVerdict(String dmarcVerdict) {
this.dmarcVerdict = dmarcVerdict;
return this;
}
/**
* Verdict of Domain-based Message Authentication Reporting and Conformance analysis
* @return dmarcVerdict
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Verdict of Domain-based Message Authentication Reporting and Conformance analysis")
public String getDmarcVerdict() {
return dmarcVerdict;
}
public void setDmarcVerdict(String dmarcVerdict) {
this.dmarcVerdict = dmarcVerdict;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmailAnalysis emailAnalysis = (EmailAnalysis) o;
return Objects.equals(this.spamVerdict, emailAnalysis.spamVerdict) &&
Objects.equals(this.virusVerdict, emailAnalysis.virusVerdict) &&
Objects.equals(this.spfVerdict, emailAnalysis.spfVerdict) &&
Objects.equals(this.dkimVerdict, emailAnalysis.dkimVerdict) &&
Objects.equals(this.dmarcVerdict, emailAnalysis.dmarcVerdict);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(spamVerdict, virusVerdict, spfVerdict, dkimVerdict, dmarcVerdict);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmailAnalysis {\n");
sb.append(" spamVerdict: ").append(toIndentedString(spamVerdict)).append("\n");
sb.append(" virusVerdict: ").append(toIndentedString(virusVerdict)).append("\n");
sb.append(" spfVerdict: ").append(toIndentedString(spfVerdict)).append("\n");
sb.append(" dkimVerdict: ").append(toIndentedString(dkimVerdict)).append("\n");
sb.append(" dmarcVerdict: ").append(toIndentedString(dmarcVerdict)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("spamVerdict");
openapiFields.add("virusVerdict");
openapiFields.add("spfVerdict");
openapiFields.add("dkimVerdict");
openapiFields.add("dmarcVerdict");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to EmailAnalysis
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!EmailAnalysis.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in EmailAnalysis is not found in the empty JSON string", EmailAnalysis.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!EmailAnalysis.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailAnalysis` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("spamVerdict") != null && !jsonObj.get("spamVerdict").isJsonNull()) && !jsonObj.get("spamVerdict").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `spamVerdict` to be a primitive type in the JSON string but got `%s`", jsonObj.get("spamVerdict").toString()));
}
if ((jsonObj.get("virusVerdict") != null && !jsonObj.get("virusVerdict").isJsonNull()) && !jsonObj.get("virusVerdict").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `virusVerdict` to be a primitive type in the JSON string but got `%s`", jsonObj.get("virusVerdict").toString()));
}
if ((jsonObj.get("spfVerdict") != null && !jsonObj.get("spfVerdict").isJsonNull()) && !jsonObj.get("spfVerdict").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `spfVerdict` to be a primitive type in the JSON string but got `%s`", jsonObj.get("spfVerdict").toString()));
}
if ((jsonObj.get("dkimVerdict") != null && !jsonObj.get("dkimVerdict").isJsonNull()) && !jsonObj.get("dkimVerdict").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `dkimVerdict` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dkimVerdict").toString()));
}
if ((jsonObj.get("dmarcVerdict") != null && !jsonObj.get("dmarcVerdict").isJsonNull()) && !jsonObj.get("dmarcVerdict").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `dmarcVerdict` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dmarcVerdict").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!EmailAnalysis.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'EmailAnalysis' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<EmailAnalysis> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(EmailAnalysis.class));
return (TypeAdapter<T>) new TypeAdapter<EmailAnalysis>() {
@Override
public void write(JsonWriter out, EmailAnalysis value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public EmailAnalysis read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of EmailAnalysis given an JSON string
*
* @param jsonString JSON string
* @return An instance of EmailAnalysis
* @throws IOException if the JSON string is invalid with respect to EmailAnalysis
*/
public static EmailAnalysis fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, EmailAnalysis.class);
}
/**
* Convert an instance of EmailAnalysis to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.EmailAnalysis;
import com.mailslurp.models.EmailRecipients;
import com.mailslurp.models.Sender;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email entity (also known as EmailDto). When an SMTP email message is received by MailSlurp it is parsed. The body and attachments are written to disk and the fields such as to, from, subject etc are stored in a database. The `body` contains the email content. If you want the original SMTP message see the `getRawEmail` endpoints. The attachments can be fetched using the AttachmentController
*/
@ApiModel(description = "Email entity (also known as EmailDto). When an SMTP email message is received by MailSlurp it is parsed. The body and attachments are written to disk and the fields such as to, from, subject etc are stored in a database. The `body` contains the email content. If you want the original SMTP message see the `getRawEmail` endpoints. The attachments can be fetched using the AttachmentController")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Email {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_TO = "to";
@SerializedName(SERIALIZED_NAME_TO)
private List<String> to = new ArrayList<>();
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_SENDER = "sender";
@SerializedName(SERIALIZED_NAME_SENDER)
private Sender sender;
public static final String SERIALIZED_NAME_RECIPIENTS = "recipients";
@SerializedName(SERIALIZED_NAME_RECIPIENTS)
private EmailRecipients recipients;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_CC = "cc";
@SerializedName(SERIALIZED_NAME_CC)
private List<String> cc = null;
public static final String SERIALIZED_NAME_BCC = "bcc";
@SerializedName(SERIALIZED_NAME_BCC)
private List<String> bcc = null;
public static final String SERIALIZED_NAME_HEADERS = "headers";
@SerializedName(SERIALIZED_NAME_HEADERS)
private Map<String, String> headers = null;
public static final String SERIALIZED_NAME_HEADERS_MAP = "headersMap";
@SerializedName(SERIALIZED_NAME_HEADERS_MAP)
private Map<String, List<String>> headersMap = null;
public static final String SERIALIZED_NAME_ATTACHMENTS = "attachments";
@SerializedName(SERIALIZED_NAME_ATTACHMENTS)
private List<String> attachments = null;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_BODY_EXCERPT = "bodyExcerpt";
@SerializedName(SERIALIZED_NAME_BODY_EXCERPT)
private String bodyExcerpt;
public static final String SERIALIZED_NAME_BODY_M_D5_HASH = "bodyMD5Hash";
@SerializedName(SERIALIZED_NAME_BODY_M_D5_HASH)
private String bodyMD5Hash;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_ANALYSIS = "analysis";
@SerializedName(SERIALIZED_NAME_ANALYSIS)
private EmailAnalysis analysis;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_READ = "read";
@SerializedName(SERIALIZED_NAME_READ)
private Boolean read;
public static final String SERIALIZED_NAME_TEAM_ACCESS = "teamAccess";
@SerializedName(SERIALIZED_NAME_TEAM_ACCESS)
private Boolean teamAccess;
public static final String SERIALIZED_NAME_HTML = "html";
@SerializedName(SERIALIZED_NAME_HTML)
private Boolean html;
public Email() {
}
public Email id(UUID id) {
this.id = id;
return this;
}
/**
* ID of the email entity
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the email entity")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public Email userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* ID of user that email belongs to
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of user that email belongs to")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public Email inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* ID of the inbox that received the email
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of the inbox that received the email")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public Email domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* ID of the domain that received the email
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of the domain that received the email")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public Email to(List<String> to) {
this.to = to;
return this;
}
public Email addToItem(String toItem) {
this.to.add(toItem);
return this;
}
/**
* List of `To` recipient email addresses that the email was addressed to. See recipients object for names.
* @return to
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of `To` recipient email addresses that the email was addressed to. See recipients object for names.")
public List<String> getTo() {
return to;
}
public void setTo(List<String> to) {
this.to = to;
}
public Email from(String from) {
this.from = from;
return this;
}
/**
* Who the email was sent from. An email address - see fromName for the sender name.
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Who the email was sent from. An email address - see fromName for the sender name.")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public Email sender(Sender sender) {
this.sender = sender;
return this;
}
/**
* Get sender
* @return sender
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Sender getSender() {
return sender;
}
public void setSender(Sender sender) {
this.sender = sender;
}
public Email recipients(EmailRecipients recipients) {
this.recipients = recipients;
return this;
}
/**
* Get recipients
* @return recipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public EmailRecipients getRecipients() {
return recipients;
}
public void setRecipients(EmailRecipients recipients) {
this.recipients = recipients;
}
public Email replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* The `replyTo` field on the received email message
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The `replyTo` field on the received email message")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public Email cc(List<String> cc) {
this.cc = cc;
return this;
}
public Email addCcItem(String ccItem) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.add(ccItem);
return this;
}
/**
* List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.
* @return cc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.")
public List<String> getCc() {
return cc;
}
public void setCc(List<String> cc) {
this.cc = cc;
}
public Email bcc(List<String> bcc) {
this.bcc = bcc;
return this;
}
public Email addBccItem(String bccItem) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
this.bcc.add(bccItem);
return this;
}
/**
* List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.
* @return bcc
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.")
public List<String> getBcc() {
return bcc;
}
public void setBcc(List<String> bcc) {
this.bcc = bcc;
}
public Email headers(Map<String, String> headers) {
this.headers = headers;
return this;
}
public Email putHeadersItem(String key, String headersItem) {
if (this.headers == null) {
this.headers = new HashMap<>();
}
this.headers.put(key, headersItem);
return this;
}
/**
* Collection of SMTP headers attached to email
* @return headers
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "Collection of SMTP headers attached to email")
public Map<String, String> getHeaders() {
return headers;
}
public void setHeaders(Map<String, String> headers) {
this.headers = headers;
}
public Email headersMap(Map<String, List<String>> headersMap) {
this.headersMap = headersMap;
return this;
}
public Email putHeadersMapItem(String key, List<String> headersMapItem) {
if (this.headersMap == null) {
this.headersMap = new HashMap<>();
}
this.headersMap.put(key, headersMapItem);
return this;
}
/**
* Multi-value map of SMTP headers attached to email
* @return headersMap
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Multi-value map of SMTP headers attached to email")
public Map<String, List<String>> getHeadersMap() {
return headersMap;
}
public void setHeadersMap(Map<String, List<String>> headersMap) {
this.headersMap = headersMap;
}
public Email attachments(List<String> attachments) {
this.attachments = attachments;
return this;
}
public Email addAttachmentsItem(String attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.
* @return attachments
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.")
public List<String> getAttachments() {
return attachments;
}
public void setAttachments(List<String> attachments) {
this.attachments = attachments;
}
public Email subject(String subject) {
this.subject = subject;
return this;
}
/**
* The subject line of the email message as specified by SMTP subject header
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The subject line of the email message as specified by SMTP subject header")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public Email body(String body) {
this.body = body;
return this;
}
/**
* The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests.
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests.")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public Email bodyExcerpt(String bodyExcerpt) {
this.bodyExcerpt = bodyExcerpt;
return this;
}
/**
* An excerpt of the body of the email message for quick preview .
* @return bodyExcerpt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "An excerpt of the body of the email message for quick preview .")
public String getBodyExcerpt() {
return bodyExcerpt;
}
public void setBodyExcerpt(String bodyExcerpt) {
this.bodyExcerpt = bodyExcerpt;
}
public Email bodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
return this;
}
/**
* A hash signature of the email message using MD5. Useful for comparing emails without fetching full body.
* @return bodyMD5Hash
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "A hash signature of the email message using MD5. Useful for comparing emails without fetching full body.")
public String getBodyMD5Hash() {
return bodyMD5Hash;
}
public void setBodyMD5Hash(String bodyMD5Hash) {
this.bodyMD5Hash = bodyMD5Hash;
}
public Email isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Is the email body content type HTML?
* @return isHTML
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Is the email body content type HTML?")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public Email charset(String charset) {
this.charset = charset;
return this;
}
/**
* Detected character set of the email body such as UTF-8
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Detected character set of the email body such as UTF-8")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public Email analysis(EmailAnalysis analysis) {
this.analysis = analysis;
return this;
}
/**
* Get analysis
* @return analysis
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public EmailAnalysis getAnalysis() {
return analysis;
}
public void setAnalysis(EmailAnalysis analysis) {
this.analysis = analysis;
}
public Email createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* When was the email received by MailSlurp
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "When was the email received by MailSlurp")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public Email updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* When was the email last updated
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "When was the email last updated")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public Email read(Boolean read) {
this.read = read;
return this;
}
/**
* Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks.
* @return read
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks.")
public Boolean getRead() {
return read;
}
public void setRead(Boolean read) {
this.read = read;
}
public Email teamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
return this;
}
/**
* Can the email be accessed by organization team members
* @return teamAccess
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Can the email be accessed by organization team members")
public Boolean getTeamAccess() {
return teamAccess;
}
public void setTeamAccess(Boolean teamAccess) {
this.teamAccess = teamAccess;
}
public Email html(Boolean html) {
this.html = html;
return this;
}
/**
* Get html
* @return html
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getHtml() {
return html;
}
public void setHtml(Boolean html) {
this.html = html;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Email email = (Email) o;
return Objects.equals(this.id, email.id) &&
Objects.equals(this.userId, email.userId) &&
Objects.equals(this.inboxId, email.inboxId) &&
Objects.equals(this.domainId, email.domainId) &&
Objects.equals(this.to, email.to) &&
Objects.equals(this.from, email.from) &&
Objects.equals(this.sender, email.sender) &&
Objects.equals(this.recipients, email.recipients) &&
Objects.equals(this.replyTo, email.replyTo) &&
Objects.equals(this.cc, email.cc) &&
Objects.equals(this.bcc, email.bcc) &&
Objects.equals(this.headers, email.headers) &&
Objects.equals(this.headersMap, email.headersMap) &&
Objects.equals(this.attachments, email.attachments) &&
Objects.equals(this.subject, email.subject) &&
Objects.equals(this.body, email.body) &&
Objects.equals(this.bodyExcerpt, email.bodyExcerpt) &&
Objects.equals(this.bodyMD5Hash, email.bodyMD5Hash) &&
Objects.equals(this.isHTML, email.isHTML) &&
Objects.equals(this.charset, email.charset) &&
Objects.equals(this.analysis, email.analysis) &&
Objects.equals(this.createdAt, email.createdAt) &&
Objects.equals(this.updatedAt, email.updatedAt) &&
Objects.equals(this.read, email.read) &&
Objects.equals(this.teamAccess, email.teamAccess) &&
Objects.equals(this.html, email.html);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, inboxId, domainId, to, from, sender, recipients, replyTo, cc, bcc, headers, headersMap, attachments, subject, body, bodyExcerpt, bodyMD5Hash, isHTML, charset, analysis, createdAt, updatedAt, read, teamAccess, html);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Email {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" to: ").append(toIndentedString(to)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" sender: ").append(toIndentedString(sender)).append("\n");
sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" cc: ").append(toIndentedString(cc)).append("\n");
sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n");
sb.append(" headers: ").append(toIndentedString(headers)).append("\n");
sb.append(" headersMap: ").append(toIndentedString(headersMap)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" bodyExcerpt: ").append(toIndentedString(bodyExcerpt)).append("\n");
sb.append(" bodyMD5Hash: ").append(toIndentedString(bodyMD5Hash)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" analysis: ").append(toIndentedString(analysis)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" read: ").append(toIndentedString(read)).append("\n");
sb.append(" teamAccess: ").append(toIndentedString(teamAccess)).append("\n");
sb.append(" html: ").append(toIndentedString(html)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("inboxId");
openapiFields.add("domainId");
openapiFields.add("to");
openapiFields.add("from");
openapiFields.add("sender");
openapiFields.add("recipients");
openapiFields.add("replyTo");
openapiFields.add("cc");
openapiFields.add("bcc");
openapiFields.add("headers");
openapiFields.add("headersMap");
openapiFields.add("attachments");
openapiFields.add("subject");
openapiFields.add("body");
openapiFields.add("bodyExcerpt");
openapiFields.add("bodyMD5Hash");
openapiFields.add("isHTML");
openapiFields.add("charset");
openapiFields.add("analysis");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("read");
openapiFields.add("teamAccess");
openapiFields.add("html");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("to");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
openapiRequiredFields.add("read");
openapiRequiredFields.add("teamAccess");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to Email
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!Email.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Email is not found in the empty JSON string", Email.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!Email.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Email` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Email.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
// ensure the required json array is present
if (jsonObj.get("to") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("to").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `to` to be an array in the JSON string but got `%s`", jsonObj.get("to").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
// validate the optional field `sender`
if (jsonObj.get("sender") != null && !jsonObj.get("sender").isJsonNull()) {
Sender.validateJsonObject(jsonObj.getAsJsonObject("sender"));
}
// validate the optional field `recipients`
if (jsonObj.get("recipients") != null && !jsonObj.get("recipients").isJsonNull()) {
EmailRecipients.validateJsonObject(jsonObj.getAsJsonObject("recipients"));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `cc` to be an array in the JSON string but got `%s`", jsonObj.get("cc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bcc") != null && !jsonObj.get("bcc").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bcc` to be an array in the JSON string but got `%s`", jsonObj.get("bcc").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("attachments") != null && !jsonObj.get("attachments").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `attachments` to be an array in the JSON string but got `%s`", jsonObj.get("attachments").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("bodyExcerpt") != null && !jsonObj.get("bodyExcerpt").isJsonNull()) && !jsonObj.get("bodyExcerpt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyExcerpt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyExcerpt").toString()));
}
if ((jsonObj.get("bodyMD5Hash") != null && !jsonObj.get("bodyMD5Hash").isJsonNull()) && !jsonObj.get("bodyMD5Hash").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bodyMD5Hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bodyMD5Hash").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
// validate the optional field `analysis`
if (jsonObj.get("analysis") != null && !jsonObj.get("analysis").isJsonNull()) {
EmailAnalysis.validateJsonObject(jsonObj.getAsJsonObject("analysis"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!Email.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'Email' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Email> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(Email.class));
return (TypeAdapter<T>) new TypeAdapter<Email>() {
@Override
public void write(JsonWriter out, Email value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public Email read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of Email given an JSON string
*
* @param jsonString JSON string
* @return An instance of Email
* @throws IOException if the JSON string is invalid with respect to Email
*/
public static Email fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Email.class);
}
/**
* Convert an instance of Email to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Content of attachment
*/
@ApiModel(description = "Content of attachment")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DownloadAttachmentDto {
public static final String SERIALIZED_NAME_BASE64_FILE_CONTENTS = "base64FileContents";
@SerializedName(SERIALIZED_NAME_BASE64_FILE_CONTENTS)
private String base64FileContents;
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public static final String SERIALIZED_NAME_SIZE_BYTES = "sizeBytes";
@SerializedName(SERIALIZED_NAME_SIZE_BYTES)
private Long sizeBytes;
public DownloadAttachmentDto() {
}
public DownloadAttachmentDto base64FileContents(String base64FileContents) {
this.base64FileContents = base64FileContents;
return this;
}
/**
* Base64 encoded string of attachment bytes. Decode the base64 encoded string to get the raw contents. If the file has a content type such as `text/html` you can read the contents directly by converting it to string using `utf-8` encoding.
* @return base64FileContents
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Base64 encoded string of attachment bytes. Decode the base64 encoded string to get the raw contents. If the file has a content type such as `text/html` you can read the contents directly by converting it to string using `utf-8` encoding.")
public String getBase64FileContents() {
return base64FileContents;
}
public void setBase64FileContents(String base64FileContents) {
this.base64FileContents = base64FileContents;
}
public DownloadAttachmentDto contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Content type of attachment. Examples are `image/png`, `application/msword`, `text/csv` etc.
* @return contentType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Content type of attachment. Examples are `image/png`, `application/msword`, `text/csv` etc.")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public DownloadAttachmentDto sizeBytes(Long sizeBytes) {
this.sizeBytes = sizeBytes;
return this;
}
/**
* Size in bytes of attachment content
* @return sizeBytes
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Size in bytes of attachment content")
public Long getSizeBytes() {
return sizeBytes;
}
public void setSizeBytes(Long sizeBytes) {
this.sizeBytes = sizeBytes;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DownloadAttachmentDto downloadAttachmentDto = (DownloadAttachmentDto) o;
return Objects.equals(this.base64FileContents, downloadAttachmentDto.base64FileContents) &&
Objects.equals(this.contentType, downloadAttachmentDto.contentType) &&
Objects.equals(this.sizeBytes, downloadAttachmentDto.sizeBytes);
}
@Override
public int hashCode() {
return Objects.hash(base64FileContents, contentType, sizeBytes);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DownloadAttachmentDto {\n");
sb.append(" base64FileContents: ").append(toIndentedString(base64FileContents)).append("\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
sb.append(" sizeBytes: ").append(toIndentedString(sizeBytes)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("base64FileContents");
openapiFields.add("contentType");
openapiFields.add("sizeBytes");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("base64FileContents");
openapiRequiredFields.add("contentType");
openapiRequiredFields.add("sizeBytes");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DownloadAttachmentDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DownloadAttachmentDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DownloadAttachmentDto is not found in the empty JSON string", DownloadAttachmentDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DownloadAttachmentDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DownloadAttachmentDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DownloadAttachmentDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("base64FileContents").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `base64FileContents` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64FileContents").toString()));
}
if (!jsonObj.get("contentType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DownloadAttachmentDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DownloadAttachmentDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DownloadAttachmentDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DownloadAttachmentDto.class));
return (TypeAdapter<T>) new TypeAdapter<DownloadAttachmentDto>() {
@Override
public void write(JsonWriter out, DownloadAttachmentDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DownloadAttachmentDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DownloadAttachmentDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of DownloadAttachmentDto
* @throws IOException if the JSON string is invalid with respect to DownloadAttachmentDto
*/
public static DownloadAttachmentDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DownloadAttachmentDto.class);
}
/**
* Convert an instance of DownloadAttachmentDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Preview object for domain entity
*/
@ApiModel(description = "Preview object for domain entity")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DomainPreview {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public static final String SERIALIZED_NAME_CATCH_ALL_INBOX_ID = "catchAllInboxId";
@SerializedName(SERIALIZED_NAME_CATCH_ALL_INBOX_ID)
private UUID catchAllInboxId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
/**
* Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
*/
@JsonAdapter(DomainTypeEnum.Adapter.class)
public enum DomainTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_DOMAIN("SMTP_DOMAIN");
private String value;
DomainTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static DomainTypeEnum fromValue(String value) {
for (DomainTypeEnum b : DomainTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<DomainTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final DomainTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public DomainTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return DomainTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_DOMAIN_TYPE = "domainType";
@SerializedName(SERIALIZED_NAME_DOMAIN_TYPE)
private DomainTypeEnum domainType;
public static final String SERIALIZED_NAME_IS_VERIFIED = "isVerified";
@SerializedName(SERIALIZED_NAME_IS_VERIFIED)
private Boolean isVerified;
public static final String SERIALIZED_NAME_HAS_MISSING_RECORDS = "hasMissingRecords";
@SerializedName(SERIALIZED_NAME_HAS_MISSING_RECORDS)
private Boolean hasMissingRecords;
public DomainPreview() {
}
public DomainPreview id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public DomainPreview domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
* @return domain
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public DomainPreview catchAllInboxId(UUID catchAllInboxId) {
this.catchAllInboxId = catchAllInboxId;
return this;
}
/**
* Get catchAllInboxId
* @return catchAllInboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getCatchAllInboxId() {
return catchAllInboxId;
}
public void setCatchAllInboxId(UUID catchAllInboxId) {
this.catchAllInboxId = catchAllInboxId;
}
public DomainPreview createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public DomainPreview domainType(DomainTypeEnum domainType) {
this.domainType = domainType;
return this;
}
/**
* Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
* @return domainType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.")
public DomainTypeEnum getDomainType() {
return domainType;
}
public void setDomainType(DomainTypeEnum domainType) {
this.domainType = domainType;
}
public DomainPreview isVerified(Boolean isVerified) {
this.isVerified = isVerified;
return this;
}
/**
* Get isVerified
* @return isVerified
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getIsVerified() {
return isVerified;
}
public void setIsVerified(Boolean isVerified) {
this.isVerified = isVerified;
}
public DomainPreview hasMissingRecords(Boolean hasMissingRecords) {
this.hasMissingRecords = hasMissingRecords;
return this;
}
/**
* Get hasMissingRecords
* @return hasMissingRecords
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getHasMissingRecords() {
return hasMissingRecords;
}
public void setHasMissingRecords(Boolean hasMissingRecords) {
this.hasMissingRecords = hasMissingRecords;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DomainPreview domainPreview = (DomainPreview) o;
return Objects.equals(this.id, domainPreview.id) &&
Objects.equals(this.domain, domainPreview.domain) &&
Objects.equals(this.catchAllInboxId, domainPreview.catchAllInboxId) &&
Objects.equals(this.createdAt, domainPreview.createdAt) &&
Objects.equals(this.domainType, domainPreview.domainType) &&
Objects.equals(this.isVerified, domainPreview.isVerified) &&
Objects.equals(this.hasMissingRecords, domainPreview.hasMissingRecords);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, domain, catchAllInboxId, createdAt, domainType, isVerified, hasMissingRecords);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DomainPreview {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" catchAllInboxId: ").append(toIndentedString(catchAllInboxId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" domainType: ").append(toIndentedString(domainType)).append("\n");
sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n");
sb.append(" hasMissingRecords: ").append(toIndentedString(hasMissingRecords)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("domain");
openapiFields.add("catchAllInboxId");
openapiFields.add("createdAt");
openapiFields.add("domainType");
openapiFields.add("isVerified");
openapiFields.add("hasMissingRecords");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("domain");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("domainType");
openapiRequiredFields.add("isVerified");
openapiRequiredFields.add("hasMissingRecords");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DomainPreview
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DomainPreview.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DomainPreview is not found in the empty JSON string", DomainPreview.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DomainPreview.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DomainPreview` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DomainPreview.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("domain").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString()));
}
if ((jsonObj.get("catchAllInboxId") != null && !jsonObj.get("catchAllInboxId").isJsonNull()) && !jsonObj.get("catchAllInboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `catchAllInboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catchAllInboxId").toString()));
}
if (!jsonObj.get("domainType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DomainPreview.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DomainPreview' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DomainPreview> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DomainPreview.class));
return (TypeAdapter<T>) new TypeAdapter<DomainPreview>() {
@Override
public void write(JsonWriter out, DomainPreview value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DomainPreview read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DomainPreview given an JSON string
*
* @param jsonString JSON string
* @return An instance of DomainPreview
* @throws IOException if the JSON string is invalid with respect to DomainPreview
*/
public static DomainPreview fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DomainPreview.class);
}
/**
* Convert an instance of DomainPreview to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* DNS Record required for verification of a domain. Record vary depending on domain type.
*/
@ApiModel(description = "DNS Record required for verification of a domain. Record vary depending on domain type.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DomainNameRecord {
/**
* Domain Name Server Record Label
*/
@JsonAdapter(LabelEnum.Adapter.class)
public enum LabelEnum {
VERIFICATION("VERIFICATION"),
MX("MX"),
SPF("SPF"),
DKIM("DKIM"),
DMARC("DMARC");
private String value;
LabelEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static LabelEnum fromValue(String value) {
for (LabelEnum b : LabelEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<LabelEnum> {
@Override
public void write(final JsonWriter jsonWriter, final LabelEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public LabelEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return LabelEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_LABEL = "label";
@SerializedName(SERIALIZED_NAME_LABEL)
private LabelEnum label;
public static final String SERIALIZED_NAME_REQUIRED = "required";
@SerializedName(SERIALIZED_NAME_REQUIRED)
private Boolean required;
/**
* Domain Name Server Record Types
*/
@JsonAdapter(RecordTypeEnum.Adapter.class)
public enum RecordTypeEnum {
A("A"),
NS("NS"),
MD("MD"),
MF("MF"),
CNAME("CNAME"),
SOA("SOA"),
MB("MB"),
MG("MG"),
MR("MR"),
NULL("NULL"),
WKS("WKS"),
PTR("PTR"),
HINFO("HINFO"),
MINFO("MINFO"),
MX("MX"),
TXT("TXT"),
RP("RP"),
AFSDB("AFSDB"),
X25("X25"),
ISDN("ISDN"),
RT("RT"),
NSAP("NSAP"),
NSAP_PTR("NSAP_PTR"),
SIG("SIG"),
KEY("KEY"),
PX("PX"),
GPOS("GPOS"),
AAAA("AAAA"),
LOC("LOC"),
NXT("NXT"),
EID("EID"),
NIMLOC("NIMLOC"),
SRV("SRV"),
ATMA("ATMA"),
NAPTR("NAPTR"),
KX("KX"),
CERT("CERT"),
A6("A6"),
DNAME("DNAME"),
SINK("SINK"),
OPT("OPT"),
APL("APL"),
DS("DS"),
SSHFP("SSHFP"),
IPSECKEY("IPSECKEY"),
RRSIG("RRSIG"),
NSEC("NSEC"),
DNSKEY("DNSKEY"),
DHCID("DHCID"),
NSEC3("NSEC3"),
NSEC3PARAM("NSEC3PARAM"),
TLSA("TLSA"),
SMIMEA("SMIMEA"),
HIP("HIP"),
NINFO("NINFO"),
RKEY("RKEY"),
TALINK("TALINK"),
CDS("CDS"),
CDNSKEY("CDNSKEY"),
OPENPGPKEY("OPENPGPKEY"),
CSYNC("CSYNC"),
ZONEMD("ZONEMD"),
SVCB("SVCB"),
HTTPS("HTTPS"),
SPF("SPF"),
UINFO("UINFO"),
UID("UID"),
GID("GID"),
UNSPEC("UNSPEC"),
NID("NID"),
L32("L32"),
L64("L64"),
LP("LP"),
EUI48("EUI48"),
EUI64("EUI64"),
TKEY("TKEY"),
TSIG("TSIG"),
IXFR("IXFR"),
AXFR("AXFR"),
MAILB("MAILB"),
MAILA("MAILA"),
ANY("ANY"),
URI("URI"),
CAA("CAA"),
AVC("AVC"),
DOA("DOA"),
AMTRELAY("AMTRELAY"),
TA("TA"),
DLV("DLV");
private String value;
RecordTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static RecordTypeEnum fromValue(String value) {
for (RecordTypeEnum b : RecordTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<RecordTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final RecordTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public RecordTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return RecordTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_RECORD_TYPE = "recordType";
@SerializedName(SERIALIZED_NAME_RECORD_TYPE)
private RecordTypeEnum recordType;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_RECORD_ENTRIES = "recordEntries";
@SerializedName(SERIALIZED_NAME_RECORD_ENTRIES)
private List<String> recordEntries = new ArrayList<>();
public static final String SERIALIZED_NAME_TTL = "ttl";
@SerializedName(SERIALIZED_NAME_TTL)
private Long ttl;
public DomainNameRecord() {
}
public DomainNameRecord label(LabelEnum label) {
this.label = label;
return this;
}
/**
* Domain Name Server Record Label
* @return label
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Domain Name Server Record Label")
public LabelEnum getLabel() {
return label;
}
public void setLabel(LabelEnum label) {
this.label = label;
}
public DomainNameRecord required(Boolean required) {
this.required = required;
return this;
}
/**
* Get required
* @return required
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getRequired() {
return required;
}
public void setRequired(Boolean required) {
this.required = required;
}
public DomainNameRecord recordType(RecordTypeEnum recordType) {
this.recordType = recordType;
return this;
}
/**
* Domain Name Server Record Types
* @return recordType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Domain Name Server Record Types")
public RecordTypeEnum getRecordType() {
return recordType;
}
public void setRecordType(RecordTypeEnum recordType) {
this.recordType = recordType;
}
public DomainNameRecord name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public DomainNameRecord recordEntries(List<String> recordEntries) {
this.recordEntries = recordEntries;
return this;
}
public DomainNameRecord addRecordEntriesItem(String recordEntriesItem) {
this.recordEntries.add(recordEntriesItem);
return this;
}
/**
* Get recordEntries
* @return recordEntries
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getRecordEntries() {
return recordEntries;
}
public void setRecordEntries(List<String> recordEntries) {
this.recordEntries = recordEntries;
}
public DomainNameRecord ttl(Long ttl) {
this.ttl = ttl;
return this;
}
/**
* Get ttl
* @return ttl
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getTtl() {
return ttl;
}
public void setTtl(Long ttl) {
this.ttl = ttl;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DomainNameRecord domainNameRecord = (DomainNameRecord) o;
return Objects.equals(this.label, domainNameRecord.label) &&
Objects.equals(this.required, domainNameRecord.required) &&
Objects.equals(this.recordType, domainNameRecord.recordType) &&
Objects.equals(this.name, domainNameRecord.name) &&
Objects.equals(this.recordEntries, domainNameRecord.recordEntries) &&
Objects.equals(this.ttl, domainNameRecord.ttl);
}
@Override
public int hashCode() {
return Objects.hash(label, required, recordType, name, recordEntries, ttl);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DomainNameRecord {\n");
sb.append(" label: ").append(toIndentedString(label)).append("\n");
sb.append(" required: ").append(toIndentedString(required)).append("\n");
sb.append(" recordType: ").append(toIndentedString(recordType)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" recordEntries: ").append(toIndentedString(recordEntries)).append("\n");
sb.append(" ttl: ").append(toIndentedString(ttl)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("label");
openapiFields.add("required");
openapiFields.add("recordType");
openapiFields.add("name");
openapiFields.add("recordEntries");
openapiFields.add("ttl");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("label");
openapiRequiredFields.add("required");
openapiRequiredFields.add("recordType");
openapiRequiredFields.add("name");
openapiRequiredFields.add("recordEntries");
openapiRequiredFields.add("ttl");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DomainNameRecord
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DomainNameRecord.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DomainNameRecord is not found in the empty JSON string", DomainNameRecord.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DomainNameRecord.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DomainNameRecord` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DomainNameRecord.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("label").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("label").toString()));
}
if (!jsonObj.get("recordType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recordType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recordType").toString()));
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
// ensure the required json array is present
if (jsonObj.get("recordEntries") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("recordEntries").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `recordEntries` to be an array in the JSON string but got `%s`", jsonObj.get("recordEntries").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DomainNameRecord.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DomainNameRecord' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DomainNameRecord> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DomainNameRecord.class));
return (TypeAdapter<T>) new TypeAdapter<DomainNameRecord>() {
@Override
public void write(JsonWriter out, DomainNameRecord value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DomainNameRecord read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DomainNameRecord given an JSON string
*
* @param jsonString JSON string
* @return An instance of DomainNameRecord
* @throws IOException if the JSON string is invalid with respect to DomainNameRecord
*/
public static DomainNameRecord fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DomainNameRecord.class);
}
/**
* Convert an instance of DomainNameRecord to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* DomainIssuesDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DomainIssuesDto {
public static final String SERIALIZED_NAME_HAS_ISSUES = "hasIssues";
@SerializedName(SERIALIZED_NAME_HAS_ISSUES)
private Boolean hasIssues;
public DomainIssuesDto() {
}
public DomainIssuesDto hasIssues(Boolean hasIssues) {
this.hasIssues = hasIssues;
return this;
}
/**
* Get hasIssues
* @return hasIssues
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getHasIssues() {
return hasIssues;
}
public void setHasIssues(Boolean hasIssues) {
this.hasIssues = hasIssues;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DomainIssuesDto domainIssuesDto = (DomainIssuesDto) o;
return Objects.equals(this.hasIssues, domainIssuesDto.hasIssues);
}
@Override
public int hashCode() {
return Objects.hash(hasIssues);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DomainIssuesDto {\n");
sb.append(" hasIssues: ").append(toIndentedString(hasIssues)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("hasIssues");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("hasIssues");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DomainIssuesDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DomainIssuesDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DomainIssuesDto is not found in the empty JSON string", DomainIssuesDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DomainIssuesDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DomainIssuesDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DomainIssuesDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DomainIssuesDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DomainIssuesDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DomainIssuesDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DomainIssuesDto.class));
return (TypeAdapter<T>) new TypeAdapter<DomainIssuesDto>() {
@Override
public void write(JsonWriter out, DomainIssuesDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DomainIssuesDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DomainIssuesDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of DomainIssuesDto
* @throws IOException if the JSON string is invalid with respect to DomainIssuesDto
*/
public static DomainIssuesDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DomainIssuesDto.class);
}
/**
* Convert an instance of DomainIssuesDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.DomainNameRecord;
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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Domain plus verification records and status
*/
@ApiModel(description = "Domain plus verification records and status")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DomainDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public static final String SERIALIZED_NAME_VERIFICATION_TOKEN = "verificationToken";
@SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN)
private String verificationToken;
public static final String SERIALIZED_NAME_DKIM_TOKENS = "dkimTokens";
@SerializedName(SERIALIZED_NAME_DKIM_TOKENS)
private List<String> dkimTokens = new ArrayList<>();
public static final String SERIALIZED_NAME_MISSING_RECORDS_MESSAGE = "missingRecordsMessage";
@SerializedName(SERIALIZED_NAME_MISSING_RECORDS_MESSAGE)
private String missingRecordsMessage;
public static final String SERIALIZED_NAME_HAS_MISSING_RECORDS = "hasMissingRecords";
@SerializedName(SERIALIZED_NAME_HAS_MISSING_RECORDS)
private Boolean hasMissingRecords;
public static final String SERIALIZED_NAME_IS_VERIFIED = "isVerified";
@SerializedName(SERIALIZED_NAME_IS_VERIFIED)
private Boolean isVerified;
public static final String SERIALIZED_NAME_DOMAIN_NAME_RECORDS = "domainNameRecords";
@SerializedName(SERIALIZED_NAME_DOMAIN_NAME_RECORDS)
private List<DomainNameRecord> domainNameRecords = new ArrayList<>();
public static final String SERIALIZED_NAME_CATCH_ALL_INBOX_ID = "catchAllInboxId";
@SerializedName(SERIALIZED_NAME_CATCH_ALL_INBOX_ID)
private UUID catchAllInboxId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
/**
* Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
*/
@JsonAdapter(DomainTypeEnum.Adapter.class)
public enum DomainTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_DOMAIN("SMTP_DOMAIN");
private String value;
DomainTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static DomainTypeEnum fromValue(String value) {
for (DomainTypeEnum b : DomainTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<DomainTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final DomainTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public DomainTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return DomainTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_DOMAIN_TYPE = "domainType";
@SerializedName(SERIALIZED_NAME_DOMAIN_TYPE)
private DomainTypeEnum domainType;
public DomainDto() {
}
public DomainDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public DomainDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public DomainDto domain(String domain) {
this.domain = domain;
return this;
}
/**
* Custom domain name
* @return domain
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Custom domain name")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public DomainDto verificationToken(String verificationToken) {
this.verificationToken = verificationToken;
return this;
}
/**
* Verification tokens
* @return verificationToken
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Verification tokens")
public String getVerificationToken() {
return verificationToken;
}
public void setVerificationToken(String verificationToken) {
this.verificationToken = verificationToken;
}
public DomainDto dkimTokens(List<String> dkimTokens) {
this.dkimTokens = dkimTokens;
return this;
}
public DomainDto addDkimTokensItem(String dkimTokensItem) {
this.dkimTokens.add(dkimTokensItem);
return this;
}
/**
* Unique token DKIM tokens
* @return dkimTokens
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Unique token DKIM tokens")
public List<String> getDkimTokens() {
return dkimTokens;
}
public void setDkimTokens(List<String> dkimTokens) {
this.dkimTokens = dkimTokens;
}
public DomainDto missingRecordsMessage(String missingRecordsMessage) {
this.missingRecordsMessage = missingRecordsMessage;
return this;
}
/**
* If the domain is missing records then show which pairs are missing.
* @return missingRecordsMessage
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "If the domain is missing records then show which pairs are missing.")
public String getMissingRecordsMessage() {
return missingRecordsMessage;
}
public void setMissingRecordsMessage(String missingRecordsMessage) {
this.missingRecordsMessage = missingRecordsMessage;
}
public DomainDto hasMissingRecords(Boolean hasMissingRecords) {
this.hasMissingRecords = hasMissingRecords;
return this;
}
/**
* Whether the domain has missing required records. If true then see the domain in the dashboard app.
* @return hasMissingRecords
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Whether the domain has missing required records. If true then see the domain in the dashboard app.")
public Boolean getHasMissingRecords() {
return hasMissingRecords;
}
public void setHasMissingRecords(Boolean hasMissingRecords) {
this.hasMissingRecords = hasMissingRecords;
}
public DomainDto isVerified(Boolean isVerified) {
this.isVerified = isVerified;
return this;
}
/**
* Whether domain has been verified or not. If the domain is not verified after 72 hours there is most likely an issue with the domains DNS records.
* @return isVerified
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Whether domain has been verified or not. If the domain is not verified after 72 hours there is most likely an issue with the domains DNS records.")
public Boolean getIsVerified() {
return isVerified;
}
public void setIsVerified(Boolean isVerified) {
this.isVerified = isVerified;
}
public DomainDto domainNameRecords(List<DomainNameRecord> domainNameRecords) {
this.domainNameRecords = domainNameRecords;
return this;
}
public DomainDto addDomainNameRecordsItem(DomainNameRecord domainNameRecordsItem) {
this.domainNameRecords.add(domainNameRecordsItem);
return this;
}
/**
* List of DNS domain name records (C, MX, TXT) etc that you must add to the DNS server associated with your domain provider.
* @return domainNameRecords
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of DNS domain name records (C, MX, TXT) etc that you must add to the DNS server associated with your domain provider.")
public List<DomainNameRecord> getDomainNameRecords() {
return domainNameRecords;
}
public void setDomainNameRecords(List<DomainNameRecord> domainNameRecords) {
this.domainNameRecords = domainNameRecords;
}
public DomainDto catchAllInboxId(UUID catchAllInboxId) {
this.catchAllInboxId = catchAllInboxId;
return this;
}
/**
* The optional catch all inbox that will receive emails sent to the domain that cannot be matched.
* @return catchAllInboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The optional catch all inbox that will receive emails sent to the domain that cannot be matched.")
public UUID getCatchAllInboxId() {
return catchAllInboxId;
}
public void setCatchAllInboxId(UUID catchAllInboxId) {
this.catchAllInboxId = catchAllInboxId;
}
public DomainDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public DomainDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public DomainDto domainType(DomainTypeEnum domainType) {
this.domainType = domainType;
return this;
}
/**
* Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
* @return domainType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.")
public DomainTypeEnum getDomainType() {
return domainType;
}
public void setDomainType(DomainTypeEnum domainType) {
this.domainType = domainType;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DomainDto domainDto = (DomainDto) o;
return Objects.equals(this.id, domainDto.id) &&
Objects.equals(this.userId, domainDto.userId) &&
Objects.equals(this.domain, domainDto.domain) &&
Objects.equals(this.verificationToken, domainDto.verificationToken) &&
Objects.equals(this.dkimTokens, domainDto.dkimTokens) &&
Objects.equals(this.missingRecordsMessage, domainDto.missingRecordsMessage) &&
Objects.equals(this.hasMissingRecords, domainDto.hasMissingRecords) &&
Objects.equals(this.isVerified, domainDto.isVerified) &&
Objects.equals(this.domainNameRecords, domainDto.domainNameRecords) &&
Objects.equals(this.catchAllInboxId, domainDto.catchAllInboxId) &&
Objects.equals(this.createdAt, domainDto.createdAt) &&
Objects.equals(this.updatedAt, domainDto.updatedAt) &&
Objects.equals(this.domainType, domainDto.domainType);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, domain, verificationToken, dkimTokens, missingRecordsMessage, hasMissingRecords, isVerified, domainNameRecords, catchAllInboxId, createdAt, updatedAt, domainType);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DomainDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" verificationToken: ").append(toIndentedString(verificationToken)).append("\n");
sb.append(" dkimTokens: ").append(toIndentedString(dkimTokens)).append("\n");
sb.append(" missingRecordsMessage: ").append(toIndentedString(missingRecordsMessage)).append("\n");
sb.append(" hasMissingRecords: ").append(toIndentedString(hasMissingRecords)).append("\n");
sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n");
sb.append(" domainNameRecords: ").append(toIndentedString(domainNameRecords)).append("\n");
sb.append(" catchAllInboxId: ").append(toIndentedString(catchAllInboxId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" domainType: ").append(toIndentedString(domainType)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("domain");
openapiFields.add("verificationToken");
openapiFields.add("dkimTokens");
openapiFields.add("missingRecordsMessage");
openapiFields.add("hasMissingRecords");
openapiFields.add("isVerified");
openapiFields.add("domainNameRecords");
openapiFields.add("catchAllInboxId");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("domainType");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("domain");
openapiRequiredFields.add("verificationToken");
openapiRequiredFields.add("dkimTokens");
openapiRequiredFields.add("hasMissingRecords");
openapiRequiredFields.add("isVerified");
openapiRequiredFields.add("domainNameRecords");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
openapiRequiredFields.add("domainType");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DomainDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DomainDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DomainDto is not found in the empty JSON string", DomainDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DomainDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DomainDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DomainDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("domain").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString()));
}
if (!jsonObj.get("verificationToken").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `verificationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationToken").toString()));
}
// ensure the required json array is present
if (jsonObj.get("dkimTokens") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("dkimTokens").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `dkimTokens` to be an array in the JSON string but got `%s`", jsonObj.get("dkimTokens").toString()));
}
if ((jsonObj.get("missingRecordsMessage") != null && !jsonObj.get("missingRecordsMessage").isJsonNull()) && !jsonObj.get("missingRecordsMessage").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `missingRecordsMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("missingRecordsMessage").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("domainNameRecords").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `domainNameRecords` to be an array in the JSON string but got `%s`", jsonObj.get("domainNameRecords").toString()));
}
JsonArray jsonArraydomainNameRecords = jsonObj.getAsJsonArray("domainNameRecords");
// validate the required field `domainNameRecords` (array)
for (int i = 0; i < jsonArraydomainNameRecords.size(); i++) {
DomainNameRecord.validateJsonObject(jsonArraydomainNameRecords.get(i).getAsJsonObject());
};
if ((jsonObj.get("catchAllInboxId") != null && !jsonObj.get("catchAllInboxId").isJsonNull()) && !jsonObj.get("catchAllInboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `catchAllInboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catchAllInboxId").toString()));
}
if (!jsonObj.get("domainType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DomainDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DomainDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DomainDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DomainDto.class));
return (TypeAdapter<T>) new TypeAdapter<DomainDto>() {
@Override
public void write(JsonWriter out, DomainDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DomainDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DomainDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of DomainDto
* @throws IOException if the JSON string is invalid with respect to DomainDto
*/
public static DomainDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DomainDto.class);
}
/**
* Convert an instance of DomainDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.NameServerRecord;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Name Server lookup result
*/
@ApiModel(description = "Name Server lookup result")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DescribeMailServerDomainResult {
public static final String SERIALIZED_NAME_MX_RECORDS = "mxRecords";
@SerializedName(SERIALIZED_NAME_MX_RECORDS)
private List<NameServerRecord> mxRecords = new ArrayList<>();
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public DescribeMailServerDomainResult() {
}
public DescribeMailServerDomainResult mxRecords(List<NameServerRecord> mxRecords) {
this.mxRecords = mxRecords;
return this;
}
public DescribeMailServerDomainResult addMxRecordsItem(NameServerRecord mxRecordsItem) {
this.mxRecords.add(mxRecordsItem);
return this;
}
/**
* Get mxRecords
* @return mxRecords
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<NameServerRecord> getMxRecords() {
return mxRecords;
}
public void setMxRecords(List<NameServerRecord> mxRecords) {
this.mxRecords = mxRecords;
}
public DescribeMailServerDomainResult domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
* @return domain
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public DescribeMailServerDomainResult message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DescribeMailServerDomainResult describeMailServerDomainResult = (DescribeMailServerDomainResult) o;
return Objects.equals(this.mxRecords, describeMailServerDomainResult.mxRecords) &&
Objects.equals(this.domain, describeMailServerDomainResult.domain) &&
Objects.equals(this.message, describeMailServerDomainResult.message);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(mxRecords, domain, message);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DescribeMailServerDomainResult {\n");
sb.append(" mxRecords: ").append(toIndentedString(mxRecords)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("mxRecords");
openapiFields.add("domain");
openapiFields.add("message");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("mxRecords");
openapiRequiredFields.add("domain");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DescribeMailServerDomainResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DescribeMailServerDomainResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DescribeMailServerDomainResult is not found in the empty JSON string", DescribeMailServerDomainResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DescribeMailServerDomainResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DescribeMailServerDomainResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DescribeMailServerDomainResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("mxRecords").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `mxRecords` to be an array in the JSON string but got `%s`", jsonObj.get("mxRecords").toString()));
}
JsonArray jsonArraymxRecords = jsonObj.getAsJsonArray("mxRecords");
// validate the required field `mxRecords` (array)
for (int i = 0; i < jsonArraymxRecords.size(); i++) {
NameServerRecord.validateJsonObject(jsonArraymxRecords.get(i).getAsJsonObject());
};
if (!jsonObj.get("domain").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString()));
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DescribeMailServerDomainResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DescribeMailServerDomainResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DescribeMailServerDomainResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DescribeMailServerDomainResult.class));
return (TypeAdapter<T>) new TypeAdapter<DescribeMailServerDomainResult>() {
@Override
public void write(JsonWriter out, DescribeMailServerDomainResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DescribeMailServerDomainResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DescribeMailServerDomainResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of DescribeMailServerDomainResult
* @throws IOException if the JSON string is invalid with respect to DescribeMailServerDomainResult
*/
public static DescribeMailServerDomainResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DescribeMailServerDomainResult.class);
}
/**
* Convert an instance of DescribeMailServerDomainResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Domain record description
*/
@ApiModel(description = "Domain record description")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DescribeDomainOptions {
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public DescribeDomainOptions() {
}
public DescribeDomainOptions domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
* @return domain
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DescribeDomainOptions describeDomainOptions = (DescribeDomainOptions) o;
return Objects.equals(this.domain, describeDomainOptions.domain);
}
@Override
public int hashCode() {
return Objects.hash(domain);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DescribeDomainOptions {\n");
sb.append(" domain: ").append(toIndentedString(domain)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("domain");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("domain");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DescribeDomainOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DescribeDomainOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DescribeDomainOptions is not found in the empty JSON string", DescribeDomainOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DescribeDomainOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DescribeDomainOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DescribeDomainOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("domain").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DescribeDomainOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DescribeDomainOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DescribeDomainOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DescribeDomainOptions.class));
return (TypeAdapter<T>) new TypeAdapter<DescribeDomainOptions>() {
@Override
public void write(JsonWriter out, DescribeDomainOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DescribeDomainOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DescribeDomainOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of DescribeDomainOptions
* @throws IOException if the JSON string is invalid with respect to DescribeDomainOptions
*/
public static DescribeDomainOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DescribeDomainOptions.class);
}
/**
* Convert an instance of DescribeDomainOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* DeliveryStatusDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DeliveryStatusDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_SENT_ID = "sentId";
@SerializedName(SERIALIZED_NAME_SENT_ID)
private UUID sentId;
public static final String SERIALIZED_NAME_REMOTE_MTA_IP = "remoteMtaIp";
@SerializedName(SERIALIZED_NAME_REMOTE_MTA_IP)
private String remoteMtaIp;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_REPORTING_MTA = "reportingMta";
@SerializedName(SERIALIZED_NAME_REPORTING_MTA)
private String reportingMta;
public static final String SERIALIZED_NAME_RECIPIENTS = "recipients";
@SerializedName(SERIALIZED_NAME_RECIPIENTS)
private List<String> recipients = null;
public static final String SERIALIZED_NAME_SMTP_RESPONSE = "smtpResponse";
@SerializedName(SERIALIZED_NAME_SMTP_RESPONSE)
private String smtpResponse;
public static final String SERIALIZED_NAME_SMTP_STATUS_CODE = "smtpStatusCode";
@SerializedName(SERIALIZED_NAME_SMTP_STATUS_CODE)
private Integer smtpStatusCode;
public static final String SERIALIZED_NAME_PROCESSING_TIME_MILLIS = "processingTimeMillis";
@SerializedName(SERIALIZED_NAME_PROCESSING_TIME_MILLIS)
private Long processingTimeMillis;
public static final String SERIALIZED_NAME_RECEIVED = "received";
@SerializedName(SERIALIZED_NAME_RECEIVED)
private OffsetDateTime received;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public DeliveryStatusDto() {
}
public DeliveryStatusDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public DeliveryStatusDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public DeliveryStatusDto sentId(UUID sentId) {
this.sentId = sentId;
return this;
}
/**
* Get sentId
* @return sentId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentId() {
return sentId;
}
public void setSentId(UUID sentId) {
this.sentId = sentId;
}
public DeliveryStatusDto remoteMtaIp(String remoteMtaIp) {
this.remoteMtaIp = remoteMtaIp;
return this;
}
/**
* Get remoteMtaIp
* @return remoteMtaIp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRemoteMtaIp() {
return remoteMtaIp;
}
public void setRemoteMtaIp(String remoteMtaIp) {
this.remoteMtaIp = remoteMtaIp;
}
public DeliveryStatusDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public DeliveryStatusDto reportingMta(String reportingMta) {
this.reportingMta = reportingMta;
return this;
}
/**
* Get reportingMta
* @return reportingMta
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getReportingMta() {
return reportingMta;
}
public void setReportingMta(String reportingMta) {
this.reportingMta = reportingMta;
}
public DeliveryStatusDto recipients(List<String> recipients) {
this.recipients = recipients;
return this;
}
public DeliveryStatusDto addRecipientsItem(String recipientsItem) {
if (this.recipients == null) {
this.recipients = new ArrayList<>();
}
this.recipients.add(recipientsItem);
return this;
}
/**
* Get recipients
* @return recipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getRecipients() {
return recipients;
}
public void setRecipients(List<String> recipients) {
this.recipients = recipients;
}
public DeliveryStatusDto smtpResponse(String smtpResponse) {
this.smtpResponse = smtpResponse;
return this;
}
/**
* Get smtpResponse
* @return smtpResponse
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSmtpResponse() {
return smtpResponse;
}
public void setSmtpResponse(String smtpResponse) {
this.smtpResponse = smtpResponse;
}
public DeliveryStatusDto smtpStatusCode(Integer smtpStatusCode) {
this.smtpStatusCode = smtpStatusCode;
return this;
}
/**
* Get smtpStatusCode
* @return smtpStatusCode
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSmtpStatusCode() {
return smtpStatusCode;
}
public void setSmtpStatusCode(Integer smtpStatusCode) {
this.smtpStatusCode = smtpStatusCode;
}
public DeliveryStatusDto processingTimeMillis(Long processingTimeMillis) {
this.processingTimeMillis = processingTimeMillis;
return this;
}
/**
* Get processingTimeMillis
* @return processingTimeMillis
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getProcessingTimeMillis() {
return processingTimeMillis;
}
public void setProcessingTimeMillis(Long processingTimeMillis) {
this.processingTimeMillis = processingTimeMillis;
}
public DeliveryStatusDto received(OffsetDateTime received) {
this.received = received;
return this;
}
/**
* Get received
* @return received
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getReceived() {
return received;
}
public void setReceived(OffsetDateTime received) {
this.received = received;
}
public DeliveryStatusDto subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public DeliveryStatusDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public DeliveryStatusDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DeliveryStatusDto deliveryStatusDto = (DeliveryStatusDto) o;
return Objects.equals(this.id, deliveryStatusDto.id) &&
Objects.equals(this.userId, deliveryStatusDto.userId) &&
Objects.equals(this.sentId, deliveryStatusDto.sentId) &&
Objects.equals(this.remoteMtaIp, deliveryStatusDto.remoteMtaIp) &&
Objects.equals(this.inboxId, deliveryStatusDto.inboxId) &&
Objects.equals(this.reportingMta, deliveryStatusDto.reportingMta) &&
Objects.equals(this.recipients, deliveryStatusDto.recipients) &&
Objects.equals(this.smtpResponse, deliveryStatusDto.smtpResponse) &&
Objects.equals(this.smtpStatusCode, deliveryStatusDto.smtpStatusCode) &&
Objects.equals(this.processingTimeMillis, deliveryStatusDto.processingTimeMillis) &&
Objects.equals(this.received, deliveryStatusDto.received) &&
Objects.equals(this.subject, deliveryStatusDto.subject) &&
Objects.equals(this.createdAt, deliveryStatusDto.createdAt) &&
Objects.equals(this.updatedAt, deliveryStatusDto.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, sentId, remoteMtaIp, inboxId, reportingMta, recipients, smtpResponse, smtpStatusCode, processingTimeMillis, received, subject, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DeliveryStatusDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" sentId: ").append(toIndentedString(sentId)).append("\n");
sb.append(" remoteMtaIp: ").append(toIndentedString(remoteMtaIp)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" reportingMta: ").append(toIndentedString(reportingMta)).append("\n");
sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n");
sb.append(" smtpResponse: ").append(toIndentedString(smtpResponse)).append("\n");
sb.append(" smtpStatusCode: ").append(toIndentedString(smtpStatusCode)).append("\n");
sb.append(" processingTimeMillis: ").append(toIndentedString(processingTimeMillis)).append("\n");
sb.append(" received: ").append(toIndentedString(received)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("sentId");
openapiFields.add("remoteMtaIp");
openapiFields.add("inboxId");
openapiFields.add("reportingMta");
openapiFields.add("recipients");
openapiFields.add("smtpResponse");
openapiFields.add("smtpStatusCode");
openapiFields.add("processingTimeMillis");
openapiFields.add("received");
openapiFields.add("subject");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DeliveryStatusDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DeliveryStatusDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DeliveryStatusDto is not found in the empty JSON string", DeliveryStatusDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DeliveryStatusDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeliveryStatusDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DeliveryStatusDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("sentId") != null && !jsonObj.get("sentId").isJsonNull()) && !jsonObj.get("sentId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentId").toString()));
}
if ((jsonObj.get("remoteMtaIp") != null && !jsonObj.get("remoteMtaIp").isJsonNull()) && !jsonObj.get("remoteMtaIp").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `remoteMtaIp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteMtaIp").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("reportingMta") != null && !jsonObj.get("reportingMta").isJsonNull()) && !jsonObj.get("reportingMta").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `reportingMta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reportingMta").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("recipients") != null && !jsonObj.get("recipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `recipients` to be an array in the JSON string but got `%s`", jsonObj.get("recipients").toString()));
}
if ((jsonObj.get("smtpResponse") != null && !jsonObj.get("smtpResponse").isJsonNull()) && !jsonObj.get("smtpResponse").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `smtpResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpResponse").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DeliveryStatusDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DeliveryStatusDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DeliveryStatusDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DeliveryStatusDto.class));
return (TypeAdapter<T>) new TypeAdapter<DeliveryStatusDto>() {
@Override
public void write(JsonWriter out, DeliveryStatusDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DeliveryStatusDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DeliveryStatusDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of DeliveryStatusDto
* @throws IOException if the JSON string is invalid with respect to DeliveryStatusDto
*/
public static DeliveryStatusDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DeliveryStatusDto.class);
}
/**
* Convert an instance of DeliveryStatusDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.DNSLookupResult;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Results of query on domain name servers
*/
@ApiModel(description = "Results of query on domain name servers")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DNSLookupResults {
public static final String SERIALIZED_NAME_RESULTS = "results";
@SerializedName(SERIALIZED_NAME_RESULTS)
private List<DNSLookupResult> results = new ArrayList<>();
public DNSLookupResults() {
}
public DNSLookupResults results(List<DNSLookupResult> results) {
this.results = results;
return this;
}
public DNSLookupResults addResultsItem(DNSLookupResult resultsItem) {
this.results.add(resultsItem);
return this;
}
/**
* Get results
* @return results
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<DNSLookupResult> getResults() {
return results;
}
public void setResults(List<DNSLookupResult> results) {
this.results = results;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DNSLookupResults dnSLookupResults = (DNSLookupResults) o;
return Objects.equals(this.results, dnSLookupResults.results);
}
@Override
public int hashCode() {
return Objects.hash(results);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DNSLookupResults {\n");
sb.append(" results: ").append(toIndentedString(results)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("results");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("results");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DNSLookupResults
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DNSLookupResults.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DNSLookupResults is not found in the empty JSON string", DNSLookupResults.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DNSLookupResults.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DNSLookupResults` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DNSLookupResults.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("results").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString()));
}
JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results");
// validate the required field `results` (array)
for (int i = 0; i < jsonArrayresults.size(); i++) {
DNSLookupResult.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject());
};
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DNSLookupResults.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DNSLookupResults' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DNSLookupResults> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DNSLookupResults.class));
return (TypeAdapter<T>) new TypeAdapter<DNSLookupResults>() {
@Override
public void write(JsonWriter out, DNSLookupResults value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DNSLookupResults read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DNSLookupResults given an JSON string
*
* @param jsonString JSON string
* @return An instance of DNSLookupResults
* @throws IOException if the JSON string is invalid with respect to DNSLookupResults
*/
public static DNSLookupResults fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DNSLookupResults.class);
}
/**
* Convert an instance of DNSLookupResults to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* DNS lookup result. Includes record type, time to live, raw response, and name value for the name server response.
*/
@ApiModel(description = "DNS lookup result. Includes record type, time to live, raw response, and name value for the name server response.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DNSLookupResult {
/**
* Domain Name Server Record Types
*/
@JsonAdapter(RecordTypeEnum.Adapter.class)
public enum RecordTypeEnum {
A("A"),
NS("NS"),
MD("MD"),
MF("MF"),
CNAME("CNAME"),
SOA("SOA"),
MB("MB"),
MG("MG"),
MR("MR"),
NULL("NULL"),
WKS("WKS"),
PTR("PTR"),
HINFO("HINFO"),
MINFO("MINFO"),
MX("MX"),
TXT("TXT"),
RP("RP"),
AFSDB("AFSDB"),
X25("X25"),
ISDN("ISDN"),
RT("RT"),
NSAP("NSAP"),
NSAP_PTR("NSAP_PTR"),
SIG("SIG"),
KEY("KEY"),
PX("PX"),
GPOS("GPOS"),
AAAA("AAAA"),
LOC("LOC"),
NXT("NXT"),
EID("EID"),
NIMLOC("NIMLOC"),
SRV("SRV"),
ATMA("ATMA"),
NAPTR("NAPTR"),
KX("KX"),
CERT("CERT"),
A6("A6"),
DNAME("DNAME"),
SINK("SINK"),
OPT("OPT"),
APL("APL"),
DS("DS"),
SSHFP("SSHFP"),
IPSECKEY("IPSECKEY"),
RRSIG("RRSIG"),
NSEC("NSEC"),
DNSKEY("DNSKEY"),
DHCID("DHCID"),
NSEC3("NSEC3"),
NSEC3PARAM("NSEC3PARAM"),
TLSA("TLSA"),
SMIMEA("SMIMEA"),
HIP("HIP"),
NINFO("NINFO"),
RKEY("RKEY"),
TALINK("TALINK"),
CDS("CDS"),
CDNSKEY("CDNSKEY"),
OPENPGPKEY("OPENPGPKEY"),
CSYNC("CSYNC"),
ZONEMD("ZONEMD"),
SVCB("SVCB"),
HTTPS("HTTPS"),
SPF("SPF"),
UINFO("UINFO"),
UID("UID"),
GID("GID"),
UNSPEC("UNSPEC"),
NID("NID"),
L32("L32"),
L64("L64"),
LP("LP"),
EUI48("EUI48"),
EUI64("EUI64"),
TKEY("TKEY"),
TSIG("TSIG"),
IXFR("IXFR"),
AXFR("AXFR"),
MAILB("MAILB"),
MAILA("MAILA"),
ANY("ANY"),
URI("URI"),
CAA("CAA"),
AVC("AVC"),
DOA("DOA"),
AMTRELAY("AMTRELAY"),
TA("TA"),
DLV("DLV");
private String value;
RecordTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static RecordTypeEnum fromValue(String value) {
for (RecordTypeEnum b : RecordTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<RecordTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final RecordTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public RecordTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return RecordTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_RECORD_TYPE = "recordType";
@SerializedName(SERIALIZED_NAME_RECORD_TYPE)
private RecordTypeEnum recordType;
public static final String SERIALIZED_NAME_TTL = "ttl";
@SerializedName(SERIALIZED_NAME_TTL)
private Long ttl;
public static final String SERIALIZED_NAME_RECORD_ENTRIES = "recordEntries";
@SerializedName(SERIALIZED_NAME_RECORD_ENTRIES)
private List<String> recordEntries = new ArrayList<>();
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public DNSLookupResult() {
}
public DNSLookupResult recordType(RecordTypeEnum recordType) {
this.recordType = recordType;
return this;
}
/**
* Domain Name Server Record Types
* @return recordType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Domain Name Server Record Types")
public RecordTypeEnum getRecordType() {
return recordType;
}
public void setRecordType(RecordTypeEnum recordType) {
this.recordType = recordType;
}
public DNSLookupResult ttl(Long ttl) {
this.ttl = ttl;
return this;
}
/**
* Get ttl
* @return ttl
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getTtl() {
return ttl;
}
public void setTtl(Long ttl) {
this.ttl = ttl;
}
public DNSLookupResult recordEntries(List<String> recordEntries) {
this.recordEntries = recordEntries;
return this;
}
public DNSLookupResult addRecordEntriesItem(String recordEntriesItem) {
this.recordEntries.add(recordEntriesItem);
return this;
}
/**
* Get recordEntries
* @return recordEntries
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getRecordEntries() {
return recordEntries;
}
public void setRecordEntries(List<String> recordEntries) {
this.recordEntries = recordEntries;
}
public DNSLookupResult name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DNSLookupResult dnSLookupResult = (DNSLookupResult) o;
return Objects.equals(this.recordType, dnSLookupResult.recordType) &&
Objects.equals(this.ttl, dnSLookupResult.ttl) &&
Objects.equals(this.recordEntries, dnSLookupResult.recordEntries) &&
Objects.equals(this.name, dnSLookupResult.name);
}
@Override
public int hashCode() {
return Objects.hash(recordType, ttl, recordEntries, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DNSLookupResult {\n");
sb.append(" recordType: ").append(toIndentedString(recordType)).append("\n");
sb.append(" ttl: ").append(toIndentedString(ttl)).append("\n");
sb.append(" recordEntries: ").append(toIndentedString(recordEntries)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("recordType");
openapiFields.add("ttl");
openapiFields.add("recordEntries");
openapiFields.add("name");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("recordType");
openapiRequiredFields.add("ttl");
openapiRequiredFields.add("recordEntries");
openapiRequiredFields.add("name");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DNSLookupResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DNSLookupResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DNSLookupResult is not found in the empty JSON string", DNSLookupResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DNSLookupResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DNSLookupResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DNSLookupResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("recordType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recordType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recordType").toString()));
}
// ensure the required json array is present
if (jsonObj.get("recordEntries") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("recordEntries").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `recordEntries` to be an array in the JSON string but got `%s`", jsonObj.get("recordEntries").toString()));
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DNSLookupResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DNSLookupResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DNSLookupResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DNSLookupResult.class));
return (TypeAdapter<T>) new TypeAdapter<DNSLookupResult>() {
@Override
public void write(JsonWriter out, DNSLookupResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DNSLookupResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DNSLookupResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of DNSLookupResult
* @throws IOException if the JSON string is invalid with respect to DNSLookupResult
*/
public static DNSLookupResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DNSLookupResult.class);
}
/**
* Convert an instance of DNSLookupResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for DNS query.
*/
@ApiModel(description = "Options for DNS query. ")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class DNSLookupOptions {
public static final String SERIALIZED_NAME_HOSTNAME = "hostname";
@SerializedName(SERIALIZED_NAME_HOSTNAME)
private String hostname;
/**
* Domain Name Server Record Types
*/
@JsonAdapter(RecordTypesEnum.Adapter.class)
public enum RecordTypesEnum {
A("A"),
NS("NS"),
MD("MD"),
MF("MF"),
CNAME("CNAME"),
SOA("SOA"),
MB("MB"),
MG("MG"),
MR("MR"),
NULL("NULL"),
WKS("WKS"),
PTR("PTR"),
HINFO("HINFO"),
MINFO("MINFO"),
MX("MX"),
TXT("TXT"),
RP("RP"),
AFSDB("AFSDB"),
X25("X25"),
ISDN("ISDN"),
RT("RT"),
NSAP("NSAP"),
NSAP_PTR("NSAP_PTR"),
SIG("SIG"),
KEY("KEY"),
PX("PX"),
GPOS("GPOS"),
AAAA("AAAA"),
LOC("LOC"),
NXT("NXT"),
EID("EID"),
NIMLOC("NIMLOC"),
SRV("SRV"),
ATMA("ATMA"),
NAPTR("NAPTR"),
KX("KX"),
CERT("CERT"),
A6("A6"),
DNAME("DNAME"),
SINK("SINK"),
OPT("OPT"),
APL("APL"),
DS("DS"),
SSHFP("SSHFP"),
IPSECKEY("IPSECKEY"),
RRSIG("RRSIG"),
NSEC("NSEC"),
DNSKEY("DNSKEY"),
DHCID("DHCID"),
NSEC3("NSEC3"),
NSEC3PARAM("NSEC3PARAM"),
TLSA("TLSA"),
SMIMEA("SMIMEA"),
HIP("HIP"),
NINFO("NINFO"),
RKEY("RKEY"),
TALINK("TALINK"),
CDS("CDS"),
CDNSKEY("CDNSKEY"),
OPENPGPKEY("OPENPGPKEY"),
CSYNC("CSYNC"),
ZONEMD("ZONEMD"),
SVCB("SVCB"),
HTTPS("HTTPS"),
SPF("SPF"),
UINFO("UINFO"),
UID("UID"),
GID("GID"),
UNSPEC("UNSPEC"),
NID("NID"),
L32("L32"),
L64("L64"),
LP("LP"),
EUI48("EUI48"),
EUI64("EUI64"),
TKEY("TKEY"),
TSIG("TSIG"),
IXFR("IXFR"),
AXFR("AXFR"),
MAILB("MAILB"),
MAILA("MAILA"),
ANY("ANY"),
URI("URI"),
CAA("CAA"),
AVC("AVC"),
DOA("DOA"),
AMTRELAY("AMTRELAY"),
TA("TA"),
DLV("DLV");
private String value;
RecordTypesEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static RecordTypesEnum fromValue(String value) {
for (RecordTypesEnum b : RecordTypesEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<RecordTypesEnum> {
@Override
public void write(final JsonWriter jsonWriter, final RecordTypesEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public RecordTypesEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return RecordTypesEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_RECORD_TYPES = "recordTypes";
@SerializedName(SERIALIZED_NAME_RECORD_TYPES)
private List<RecordTypesEnum> recordTypes = new ArrayList<>();
public static final String SERIALIZED_NAME_OMIT_FINAL_D_N_S_DOT = "omitFinalDNSDot";
@SerializedName(SERIALIZED_NAME_OMIT_FINAL_D_N_S_DOT)
private Boolean omitFinalDNSDot;
public DNSLookupOptions() {
}
public DNSLookupOptions hostname(String hostname) {
this.hostname = hostname;
return this;
}
/**
* List of record types you wish to query such as MX, DNS, TXT, NS, A etc.
* @return hostname
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of record types you wish to query such as MX, DNS, TXT, NS, A etc.")
public String getHostname() {
return hostname;
}
public void setHostname(String hostname) {
this.hostname = hostname;
}
public DNSLookupOptions recordTypes(List<RecordTypesEnum> recordTypes) {
this.recordTypes = recordTypes;
return this;
}
public DNSLookupOptions addRecordTypesItem(RecordTypesEnum recordTypesItem) {
this.recordTypes.add(recordTypesItem);
return this;
}
/**
* List of record types you wish to query such as MX, DNS, TXT, NS, A etc.
* @return recordTypes
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "List of record types you wish to query such as MX, DNS, TXT, NS, A etc.")
public List<RecordTypesEnum> getRecordTypes() {
return recordTypes;
}
public void setRecordTypes(List<RecordTypesEnum> recordTypes) {
this.recordTypes = recordTypes;
}
public DNSLookupOptions omitFinalDNSDot(Boolean omitFinalDNSDot) {
this.omitFinalDNSDot = omitFinalDNSDot;
return this;
}
/**
* Optionally control whether to omit the final dot in full DNS name values.
* @return omitFinalDNSDot
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Optionally control whether to omit the final dot in full DNS name values.")
public Boolean getOmitFinalDNSDot() {
return omitFinalDNSDot;
}
public void setOmitFinalDNSDot(Boolean omitFinalDNSDot) {
this.omitFinalDNSDot = omitFinalDNSDot;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DNSLookupOptions dnSLookupOptions = (DNSLookupOptions) o;
return Objects.equals(this.hostname, dnSLookupOptions.hostname) &&
Objects.equals(this.recordTypes, dnSLookupOptions.recordTypes) &&
Objects.equals(this.omitFinalDNSDot, dnSLookupOptions.omitFinalDNSDot);
}
@Override
public int hashCode() {
return Objects.hash(hostname, recordTypes, omitFinalDNSDot);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DNSLookupOptions {\n");
sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n");
sb.append(" recordTypes: ").append(toIndentedString(recordTypes)).append("\n");
sb.append(" omitFinalDNSDot: ").append(toIndentedString(omitFinalDNSDot)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("hostname");
openapiFields.add("recordTypes");
openapiFields.add("omitFinalDNSDot");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("hostname");
openapiRequiredFields.add("recordTypes");
openapiRequiredFields.add("omitFinalDNSDot");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to DNSLookupOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!DNSLookupOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in DNSLookupOptions is not found in the empty JSON string", DNSLookupOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!DNSLookupOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DNSLookupOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DNSLookupOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("hostname").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString()));
}
// ensure the required json array is present
if (jsonObj.get("recordTypes") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("recordTypes").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `recordTypes` to be an array in the JSON string but got `%s`", jsonObj.get("recordTypes").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!DNSLookupOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'DNSLookupOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<DNSLookupOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(DNSLookupOptions.class));
return (TypeAdapter<T>) new TypeAdapter<DNSLookupOptions>() {
@Override
public void write(JsonWriter out, DNSLookupOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public DNSLookupOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of DNSLookupOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of DNSLookupOptions
* @throws IOException if the JSON string is invalid with respect to DNSLookupOptions
*/
public static DNSLookupOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DNSLookupOptions.class);
}
/**
* Convert an instance of DNSLookupOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.BasicAuthOptions;
import com.mailslurp.models.WebhookHeaders;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale. Customize the payload sent to your endpoint by setting the `requestBodyTemplate` property to a string with moustache style variables. Property names from the standard payload model for the given event are available as variables.
*/
@ApiModel(description = "Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale. Customize the payload sent to your endpoint by setting the `requestBodyTemplate` property to a string with moustache style variables. Property names from the standard payload model for the given event are available as variables.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateWebhookOptions {
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
public static final String SERIALIZED_NAME_BASIC_AUTH = "basicAuth";
@SerializedName(SERIALIZED_NAME_BASIC_AUTH)
private BasicAuthOptions basicAuth;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_INCLUDE_HEADERS = "includeHeaders";
@SerializedName(SERIALIZED_NAME_INCLUDE_HEADERS)
private WebhookHeaders includeHeaders;
public static final String SERIALIZED_NAME_REQUEST_BODY_TEMPLATE = "requestBodyTemplate";
@SerializedName(SERIALIZED_NAME_REQUEST_BODY_TEMPLATE)
private String requestBodyTemplate;
public static final String SERIALIZED_NAME_USE_STATIC_IP_RANGE = "useStaticIpRange";
@SerializedName(SERIALIZED_NAME_USE_STATIC_IP_RANGE)
private Boolean useStaticIpRange = false;
public static final String SERIALIZED_NAME_IGNORE_INSECURE_SSL_CERTIFICATES = "ignoreInsecureSslCertificates";
@SerializedName(SERIALIZED_NAME_IGNORE_INSECURE_SSL_CERTIFICATES)
private Boolean ignoreInsecureSslCertificates;
public CreateWebhookOptions() {
}
public CreateWebhookOptions url(String url) {
this.url = url;
return this;
}
/**
* Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation.
* @return url
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation.")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public CreateWebhookOptions basicAuth(BasicAuthOptions basicAuth) {
this.basicAuth = basicAuth;
return this;
}
/**
* Get basicAuth
* @return basicAuth
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public BasicAuthOptions getBasicAuth() {
return basicAuth;
}
public void setBasicAuth(BasicAuthOptions basicAuth) {
this.basicAuth = basicAuth;
}
public CreateWebhookOptions name(String name) {
this.name = name;
return this;
}
/**
* Optional name for the webhook
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional name for the webhook")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateWebhookOptions eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.
* @return eventName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public CreateWebhookOptions includeHeaders(WebhookHeaders includeHeaders) {
this.includeHeaders = includeHeaders;
return this;
}
/**
* Get includeHeaders
* @return includeHeaders
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public WebhookHeaders getIncludeHeaders() {
return includeHeaders;
}
public void setIncludeHeaders(WebhookHeaders includeHeaders) {
this.includeHeaders = includeHeaders;
}
public CreateWebhookOptions requestBodyTemplate(String requestBodyTemplate) {
this.requestBodyTemplate = requestBodyTemplate;
return this;
}
/**
* Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style `{{variableName}}` templating to use parts of the standard webhook payload for the given event.
* @return requestBodyTemplate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style `{{variableName}}` templating to use parts of the standard webhook payload for the given event.")
public String getRequestBodyTemplate() {
return requestBodyTemplate;
}
public void setRequestBodyTemplate(String requestBodyTemplate) {
this.requestBodyTemplate = requestBodyTemplate;
}
public CreateWebhookOptions useStaticIpRange(Boolean useStaticIpRange) {
this.useStaticIpRange = useStaticIpRange;
return this;
}
/**
* Use static IP range when calling webhook endpoint
* @return useStaticIpRange
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Use static IP range when calling webhook endpoint")
public Boolean getUseStaticIpRange() {
return useStaticIpRange;
}
public void setUseStaticIpRange(Boolean useStaticIpRange) {
this.useStaticIpRange = useStaticIpRange;
}
public CreateWebhookOptions ignoreInsecureSslCertificates(Boolean ignoreInsecureSslCertificates) {
this.ignoreInsecureSslCertificates = ignoreInsecureSslCertificates;
return this;
}
/**
* Ignore insecure SSL certificates when sending request. Useful for self-signed certs.
* @return ignoreInsecureSslCertificates
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Ignore insecure SSL certificates when sending request. Useful for self-signed certs.")
public Boolean getIgnoreInsecureSslCertificates() {
return ignoreInsecureSslCertificates;
}
public void setIgnoreInsecureSslCertificates(Boolean ignoreInsecureSslCertificates) {
this.ignoreInsecureSslCertificates = ignoreInsecureSslCertificates;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateWebhookOptions createWebhookOptions = (CreateWebhookOptions) o;
return Objects.equals(this.url, createWebhookOptions.url) &&
Objects.equals(this.basicAuth, createWebhookOptions.basicAuth) &&
Objects.equals(this.name, createWebhookOptions.name) &&
Objects.equals(this.eventName, createWebhookOptions.eventName) &&
Objects.equals(this.includeHeaders, createWebhookOptions.includeHeaders) &&
Objects.equals(this.requestBodyTemplate, createWebhookOptions.requestBodyTemplate) &&
Objects.equals(this.useStaticIpRange, createWebhookOptions.useStaticIpRange) &&
Objects.equals(this.ignoreInsecureSslCertificates, createWebhookOptions.ignoreInsecureSslCertificates);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(url, basicAuth, name, eventName, includeHeaders, requestBodyTemplate, useStaticIpRange, ignoreInsecureSslCertificates);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateWebhookOptions {\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" includeHeaders: ").append(toIndentedString(includeHeaders)).append("\n");
sb.append(" requestBodyTemplate: ").append(toIndentedString(requestBodyTemplate)).append("\n");
sb.append(" useStaticIpRange: ").append(toIndentedString(useStaticIpRange)).append("\n");
sb.append(" ignoreInsecureSslCertificates: ").append(toIndentedString(ignoreInsecureSslCertificates)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("url");
openapiFields.add("basicAuth");
openapiFields.add("name");
openapiFields.add("eventName");
openapiFields.add("includeHeaders");
openapiFields.add("requestBodyTemplate");
openapiFields.add("useStaticIpRange");
openapiFields.add("ignoreInsecureSslCertificates");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("url");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateWebhookOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateWebhookOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWebhookOptions is not found in the empty JSON string", CreateWebhookOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateWebhookOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWebhookOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateWebhookOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("url").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString()));
}
// validate the optional field `basicAuth`
if (jsonObj.get("basicAuth") != null && !jsonObj.get("basicAuth").isJsonNull()) {
BasicAuthOptions.validateJsonObject(jsonObj.getAsJsonObject("basicAuth"));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonNull()) && !jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
// validate the optional field `includeHeaders`
if (jsonObj.get("includeHeaders") != null && !jsonObj.get("includeHeaders").isJsonNull()) {
WebhookHeaders.validateJsonObject(jsonObj.getAsJsonObject("includeHeaders"));
}
if ((jsonObj.get("requestBodyTemplate") != null && !jsonObj.get("requestBodyTemplate").isJsonNull()) && !jsonObj.get("requestBodyTemplate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `requestBodyTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestBodyTemplate").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateWebhookOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateWebhookOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateWebhookOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateWebhookOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateWebhookOptions>() {
@Override
public void write(JsonWriter out, CreateWebhookOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateWebhookOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateWebhookOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateWebhookOptions
* @throws IOException if the JSON string is invalid with respect to CreateWebhookOptions
*/
public static CreateWebhookOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateWebhookOptions.class);
}
/**
* Convert an instance of CreateWebhookOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating a tracking pixel for email open tracking
*/
@ApiModel(description = "Options for creating a tracking pixel for email open tracking")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateTrackingPixelOptions {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public CreateTrackingPixelOptions() {
}
public CreateTrackingPixelOptions name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateTrackingPixelOptions recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Get recipient
* @return recipient
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateTrackingPixelOptions createTrackingPixelOptions = (CreateTrackingPixelOptions) o;
return Objects.equals(this.name, createTrackingPixelOptions.name) &&
Objects.equals(this.recipient, createTrackingPixelOptions.recipient);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(name, recipient);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateTrackingPixelOptions {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("recipient");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateTrackingPixelOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateTrackingPixelOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTrackingPixelOptions is not found in the empty JSON string", CreateTrackingPixelOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateTrackingPixelOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTrackingPixelOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("recipient") != null && !jsonObj.get("recipient").isJsonNull()) && !jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateTrackingPixelOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateTrackingPixelOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateTrackingPixelOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateTrackingPixelOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateTrackingPixelOptions>() {
@Override
public void write(JsonWriter out, CreateTrackingPixelOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateTrackingPixelOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateTrackingPixelOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateTrackingPixelOptions
* @throws IOException if the JSON string is invalid with respect to CreateTrackingPixelOptions
*/
public static CreateTrackingPixelOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateTrackingPixelOptions.class);
}
/**
* Convert an instance of CreateTrackingPixelOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Create template options
*/
@ApiModel(description = "Create template options")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateTemplateOptions {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CONTENT = "content";
@SerializedName(SERIALIZED_NAME_CONTENT)
private String content;
public CreateTemplateOptions() {
}
public CreateTemplateOptions name(String name) {
this.name = name;
return this;
}
/**
* Name of template
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of template")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateTemplateOptions content(String content) {
this.content = content;
return this;
}
/**
* Template content. Can include moustache style variables such as {{var_name}}
* @return content
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Template content. Can include moustache style variables such as {{var_name}}")
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateTemplateOptions createTemplateOptions = (CreateTemplateOptions) o;
return Objects.equals(this.name, createTemplateOptions.name) &&
Objects.equals(this.content, createTemplateOptions.content);
}
@Override
public int hashCode() {
return Objects.hash(name, content);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateTemplateOptions {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" content: ").append(toIndentedString(content)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("content");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
openapiRequiredFields.add("content");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateTemplateOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateTemplateOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTemplateOptions is not found in the empty JSON string", CreateTemplateOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateTemplateOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTemplateOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateTemplateOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("content").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateTemplateOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateTemplateOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateTemplateOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateTemplateOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateTemplateOptions>() {
@Override
public void write(JsonWriter out, CreateTemplateOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateTemplateOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateTemplateOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateTemplateOptions
* @throws IOException if the JSON string is invalid with respect to CreateTemplateOptions
*/
public static CreateTemplateOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateTemplateOptions.class);
}
/**
* Convert an instance of CreateTemplateOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, filter, or forward emails when sending or receiving using the inbox.
*/
@ApiModel(description = "Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, filter, or forward emails when sending or receiving using the inbox.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateInboxRulesetOptions {
/**
* What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively.
*/
@JsonAdapter(ScopeEnum.Adapter.class)
public enum ScopeEnum {
RECEIVING_EMAILS("RECEIVING_EMAILS"),
SENDING_EMAILS("SENDING_EMAILS");
private String value;
ScopeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ScopeEnum fromValue(String value) {
for (ScopeEnum b : ScopeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ScopeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ScopeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ScopeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ScopeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SCOPE = "scope";
@SerializedName(SERIALIZED_NAME_SCOPE)
private ScopeEnum scope;
/**
* Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action.
*/
@JsonAdapter(ActionEnum.Adapter.class)
public enum ActionEnum {
BLOCK("BLOCK"),
ALLOW("ALLOW"),
FILTER_REMOVE("FILTER_REMOVE");
private String value;
ActionEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ActionEnum fromValue(String value) {
for (ActionEnum b : ActionEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ActionEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ActionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ActionEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ACTION = "action";
@SerializedName(SERIALIZED_NAME_ACTION)
private ActionEnum action;
public static final String SERIALIZED_NAME_TARGET = "target";
@SerializedName(SERIALIZED_NAME_TARGET)
private String target;
public CreateInboxRulesetOptions() {
}
public CreateInboxRulesetOptions scope(ScopeEnum scope) {
this.scope = scope;
return this;
}
/**
* What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively.
* @return scope
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively.")
public ScopeEnum getScope() {
return scope;
}
public void setScope(ScopeEnum scope) {
this.scope = scope;
}
public CreateInboxRulesetOptions action(ActionEnum action) {
this.action = action;
return this;
}
/**
* Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action.
* @return action
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action.")
public ActionEnum getAction() {
return action;
}
public void setAction(ActionEnum action) {
this.action = action;
}
public CreateInboxRulesetOptions target(String target) {
this.target = target;
return this;
}
/**
* Target to match emails with. Can be a wild-card type pattern or a valid email address. For instance `*@gmail.com` matches all gmail addresses while `test@gmail.com` matches one address exactly. The target is applied to every recipient field email address when `SENDING_EMAILS` is the scope and is applied to sender of email when `RECEIVING_EMAILS`.
* @return target
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Target to match emails with. Can be a wild-card type pattern or a valid email address. For instance `*@gmail.com` matches all gmail addresses while `test@gmail.com` matches one address exactly. The target is applied to every recipient field email address when `SENDING_EMAILS` is the scope and is applied to sender of email when `RECEIVING_EMAILS`.")
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateInboxRulesetOptions createInboxRulesetOptions = (CreateInboxRulesetOptions) o;
return Objects.equals(this.scope, createInboxRulesetOptions.scope) &&
Objects.equals(this.action, createInboxRulesetOptions.action) &&
Objects.equals(this.target, createInboxRulesetOptions.target);
}
@Override
public int hashCode() {
return Objects.hash(scope, action, target);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateInboxRulesetOptions {\n");
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
sb.append(" action: ").append(toIndentedString(action)).append("\n");
sb.append(" target: ").append(toIndentedString(target)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("scope");
openapiFields.add("action");
openapiFields.add("target");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("scope");
openapiRequiredFields.add("action");
openapiRequiredFields.add("target");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateInboxRulesetOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateInboxRulesetOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInboxRulesetOptions is not found in the empty JSON string", CreateInboxRulesetOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateInboxRulesetOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInboxRulesetOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateInboxRulesetOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("scope").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString()));
}
if (!jsonObj.get("action").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString()));
}
if (!jsonObj.get("target").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `target` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateInboxRulesetOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateInboxRulesetOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateInboxRulesetOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateInboxRulesetOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateInboxRulesetOptions>() {
@Override
public void write(JsonWriter out, CreateInboxRulesetOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateInboxRulesetOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateInboxRulesetOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateInboxRulesetOptions
* @throws IOException if the JSON string is invalid with respect to CreateInboxRulesetOptions
*/
public static CreateInboxRulesetOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateInboxRulesetOptions.class);
}
/**
* Convert an instance of CreateInboxRulesetOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating an inbox replier. Repliers can be attached to inboxes and send automated responses when an inbound email matches given criteria.
*/
@ApiModel(description = "Options for creating an inbox replier. Repliers can be attached to inboxes and send automated responses when an inbound email matches given criteria.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateInboxReplierOptions {
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
/**
* Field to match against to trigger inbox replier for inbound email
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
RECIPIENTS("RECIPIENTS"),
SENDER("SENDER"),
SUBJECT("SUBJECT"),
ATTACHMENTS("ATTACHMENTS");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
public static final String SERIALIZED_NAME_MATCH = "match";
@SerializedName(SERIALIZED_NAME_MATCH)
private String match;
public static final String SERIALIZED_NAME_REPLY_TO = "replyTo";
@SerializedName(SERIALIZED_NAME_REPLY_TO)
private String replyTo;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_FROM = "from";
@SerializedName(SERIALIZED_NAME_FROM)
private String from;
public static final String SERIALIZED_NAME_CHARSET = "charset";
@SerializedName(SERIALIZED_NAME_CHARSET)
private String charset;
public static final String SERIALIZED_NAME_IGNORE_REPLY_TO = "ignoreReplyTo";
@SerializedName(SERIALIZED_NAME_IGNORE_REPLY_TO)
private Boolean ignoreReplyTo;
public static final String SERIALIZED_NAME_IS_H_T_M_L = "isHTML";
@SerializedName(SERIALIZED_NAME_IS_H_T_M_L)
private Boolean isHTML;
public static final String SERIALIZED_NAME_BODY = "body";
@SerializedName(SERIALIZED_NAME_BODY)
private String body;
public static final String SERIALIZED_NAME_TEMPLATE_ID = "templateId";
@SerializedName(SERIALIZED_NAME_TEMPLATE_ID)
private UUID templateId;
public static final String SERIALIZED_NAME_TEMPLATE_VARIABLES = "templateVariables";
@SerializedName(SERIALIZED_NAME_TEMPLATE_VARIABLES)
private Map<String, Object> templateVariables = null;
public CreateInboxReplierOptions() {
}
public CreateInboxReplierOptions inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Inbox ID to attach replier to
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inbox ID to attach replier to")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public CreateInboxReplierOptions name(String name) {
this.name = name;
return this;
}
/**
* Name for replier
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Name for replier")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateInboxReplierOptions field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Field to match against to trigger inbox replier for inbound email
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Field to match against to trigger inbox replier for inbound email")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public CreateInboxReplierOptions match(String match) {
this.match = match;
return this;
}
/**
* String or wildcard style match for field specified when evaluating reply rules. Use `*` to match anything.
* @return match
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "String or wildcard style match for field specified when evaluating reply rules. Use `*` to match anything.")
public String getMatch() {
return match;
}
public void setMatch(String match) {
this.match = match;
}
public CreateInboxReplierOptions replyTo(String replyTo) {
this.replyTo = replyTo;
return this;
}
/**
* Reply-to email address when sending replying
* @return replyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Reply-to email address when sending replying")
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public CreateInboxReplierOptions subject(String subject) {
this.subject = subject;
return this;
}
/**
* Subject override when replying to email
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Subject override when replying to email")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public CreateInboxReplierOptions from(String from) {
this.from = from;
return this;
}
/**
* Send email from address
* @return from
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Send email from address")
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public CreateInboxReplierOptions charset(String charset) {
this.charset = charset;
return this;
}
/**
* Email reply charset
* @return charset
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email reply charset")
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public CreateInboxReplierOptions ignoreReplyTo(Boolean ignoreReplyTo) {
this.ignoreReplyTo = ignoreReplyTo;
return this;
}
/**
* Ignore sender replyTo when responding. Send directly to the sender if enabled.
* @return ignoreReplyTo
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Ignore sender replyTo when responding. Send directly to the sender if enabled.")
public Boolean getIgnoreReplyTo() {
return ignoreReplyTo;
}
public void setIgnoreReplyTo(Boolean ignoreReplyTo) {
this.ignoreReplyTo = ignoreReplyTo;
}
public CreateInboxReplierOptions isHTML(Boolean isHTML) {
this.isHTML = isHTML;
return this;
}
/**
* Send HTML email
* @return isHTML
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Send HTML email")
public Boolean getIsHTML() {
return isHTML;
}
public void setIsHTML(Boolean isHTML) {
this.isHTML = isHTML;
}
public CreateInboxReplierOptions body(String body) {
this.body = body;
return this;
}
/**
* Email body for reply
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Email body for reply")
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public CreateInboxReplierOptions templateId(UUID templateId) {
this.templateId = templateId;
return this;
}
/**
* ID of template to use when sending a reply
* @return templateId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of template to use when sending a reply")
public UUID getTemplateId() {
return templateId;
}
public void setTemplateId(UUID templateId) {
this.templateId = templateId;
}
public CreateInboxReplierOptions templateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
return this;
}
public CreateInboxReplierOptions putTemplateVariablesItem(String key, Object templateVariablesItem) {
if (this.templateVariables == null) {
this.templateVariables = new HashMap<>();
}
this.templateVariables.put(key, templateVariablesItem);
return this;
}
/**
* Template variable values
* @return templateVariables
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Template variable values")
public Map<String, Object> getTemplateVariables() {
return templateVariables;
}
public void setTemplateVariables(Map<String, Object> templateVariables) {
this.templateVariables = templateVariables;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateInboxReplierOptions createInboxReplierOptions = (CreateInboxReplierOptions) o;
return Objects.equals(this.inboxId, createInboxReplierOptions.inboxId) &&
Objects.equals(this.name, createInboxReplierOptions.name) &&
Objects.equals(this.field, createInboxReplierOptions.field) &&
Objects.equals(this.match, createInboxReplierOptions.match) &&
Objects.equals(this.replyTo, createInboxReplierOptions.replyTo) &&
Objects.equals(this.subject, createInboxReplierOptions.subject) &&
Objects.equals(this.from, createInboxReplierOptions.from) &&
Objects.equals(this.charset, createInboxReplierOptions.charset) &&
Objects.equals(this.ignoreReplyTo, createInboxReplierOptions.ignoreReplyTo) &&
Objects.equals(this.isHTML, createInboxReplierOptions.isHTML) &&
Objects.equals(this.body, createInboxReplierOptions.body) &&
Objects.equals(this.templateId, createInboxReplierOptions.templateId) &&
Objects.equals(this.templateVariables, createInboxReplierOptions.templateVariables);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(inboxId, name, field, match, replyTo, subject, from, charset, ignoreReplyTo, isHTML, body, templateId, templateVariables);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateInboxReplierOptions {\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" match: ").append(toIndentedString(match)).append("\n");
sb.append(" replyTo: ").append(toIndentedString(replyTo)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" from: ").append(toIndentedString(from)).append("\n");
sb.append(" charset: ").append(toIndentedString(charset)).append("\n");
sb.append(" ignoreReplyTo: ").append(toIndentedString(ignoreReplyTo)).append("\n");
sb.append(" isHTML: ").append(toIndentedString(isHTML)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n");
sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxId");
openapiFields.add("name");
openapiFields.add("field");
openapiFields.add("match");
openapiFields.add("replyTo");
openapiFields.add("subject");
openapiFields.add("from");
openapiFields.add("charset");
openapiFields.add("ignoreReplyTo");
openapiFields.add("isHTML");
openapiFields.add("body");
openapiFields.add("templateId");
openapiFields.add("templateVariables");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("field");
openapiRequiredFields.add("match");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateInboxReplierOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateInboxReplierOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInboxReplierOptions is not found in the empty JSON string", CreateInboxReplierOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateInboxReplierOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInboxReplierOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateInboxReplierOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("match").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `match` to be a primitive type in the JSON string but got `%s`", jsonObj.get("match").toString()));
}
if ((jsonObj.get("replyTo") != null && !jsonObj.get("replyTo").isJsonNull()) && !jsonObj.get("replyTo").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `replyTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("replyTo").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString()));
}
if ((jsonObj.get("charset") != null && !jsonObj.get("charset").isJsonNull()) && !jsonObj.get("charset").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `charset` to be a primitive type in the JSON string but got `%s`", jsonObj.get("charset").toString()));
}
if ((jsonObj.get("body") != null && !jsonObj.get("body").isJsonNull()) && !jsonObj.get("body").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString()));
}
if ((jsonObj.get("templateId") != null && !jsonObj.get("templateId").isJsonNull()) && !jsonObj.get("templateId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `templateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateInboxReplierOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateInboxReplierOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateInboxReplierOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateInboxReplierOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateInboxReplierOptions>() {
@Override
public void write(JsonWriter out, CreateInboxReplierOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateInboxReplierOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateInboxReplierOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateInboxReplierOptions
* @throws IOException if the JSON string is invalid with respect to CreateInboxReplierOptions
*/
public static CreateInboxReplierOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateInboxReplierOptions.class);
}
/**
* Convert an instance of CreateInboxReplierOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating an inbox forwarder
*/
@ApiModel(description = "Options for creating an inbox forwarder")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateInboxForwarderOptions {
/**
* Field to match against to trigger inbox forwarding for inbound email
*/
@JsonAdapter(FieldEnum.Adapter.class)
public enum FieldEnum {
RECIPIENTS("RECIPIENTS"),
SENDER("SENDER"),
SUBJECT("SUBJECT"),
ATTACHMENTS("ATTACHMENTS");
private String value;
FieldEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static FieldEnum fromValue(String value) {
for (FieldEnum b : FieldEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<FieldEnum> {
@Override
public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public FieldEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return FieldEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_FIELD = "field";
@SerializedName(SERIALIZED_NAME_FIELD)
private FieldEnum field;
public static final String SERIALIZED_NAME_MATCH = "match";
@SerializedName(SERIALIZED_NAME_MATCH)
private String match;
public static final String SERIALIZED_NAME_FORWARD_TO_RECIPIENTS = "forwardToRecipients";
@SerializedName(SERIALIZED_NAME_FORWARD_TO_RECIPIENTS)
private List<String> forwardToRecipients = new ArrayList<>();
public CreateInboxForwarderOptions() {
}
public CreateInboxForwarderOptions field(FieldEnum field) {
this.field = field;
return this;
}
/**
* Field to match against to trigger inbox forwarding for inbound email
* @return field
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Field to match against to trigger inbox forwarding for inbound email")
public FieldEnum getField() {
return field;
}
public void setField(FieldEnum field) {
this.field = field;
}
public CreateInboxForwarderOptions match(String match) {
this.match = match;
return this;
}
/**
* String or wildcard style match for field specified when evaluating forwarding rules
* @return match
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "String or wildcard style match for field specified when evaluating forwarding rules")
public String getMatch() {
return match;
}
public void setMatch(String match) {
this.match = match;
}
public CreateInboxForwarderOptions forwardToRecipients(List<String> forwardToRecipients) {
this.forwardToRecipients = forwardToRecipients;
return this;
}
public CreateInboxForwarderOptions addForwardToRecipientsItem(String forwardToRecipientsItem) {
this.forwardToRecipients.add(forwardToRecipientsItem);
return this;
}
/**
* Email addresses to forward an email to if it matches the field and match criteria of the forwarder
* @return forwardToRecipients
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Email addresses to forward an email to if it matches the field and match criteria of the forwarder")
public List<String> getForwardToRecipients() {
return forwardToRecipients;
}
public void setForwardToRecipients(List<String> forwardToRecipients) {
this.forwardToRecipients = forwardToRecipients;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateInboxForwarderOptions createInboxForwarderOptions = (CreateInboxForwarderOptions) o;
return Objects.equals(this.field, createInboxForwarderOptions.field) &&
Objects.equals(this.match, createInboxForwarderOptions.match) &&
Objects.equals(this.forwardToRecipients, createInboxForwarderOptions.forwardToRecipients);
}
@Override
public int hashCode() {
return Objects.hash(field, match, forwardToRecipients);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateInboxForwarderOptions {\n");
sb.append(" field: ").append(toIndentedString(field)).append("\n");
sb.append(" match: ").append(toIndentedString(match)).append("\n");
sb.append(" forwardToRecipients: ").append(toIndentedString(forwardToRecipients)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("field");
openapiFields.add("match");
openapiFields.add("forwardToRecipients");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("field");
openapiRequiredFields.add("match");
openapiRequiredFields.add("forwardToRecipients");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateInboxForwarderOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateInboxForwarderOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInboxForwarderOptions is not found in the empty JSON string", CreateInboxForwarderOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateInboxForwarderOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInboxForwarderOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateInboxForwarderOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("field").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString()));
}
if (!jsonObj.get("match").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `match` to be a primitive type in the JSON string but got `%s`", jsonObj.get("match").toString()));
}
// ensure the required json array is present
if (jsonObj.get("forwardToRecipients") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("forwardToRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `forwardToRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("forwardToRecipients").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateInboxForwarderOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateInboxForwarderOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateInboxForwarderOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateInboxForwarderOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateInboxForwarderOptions>() {
@Override
public void write(JsonWriter out, CreateInboxForwarderOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateInboxForwarderOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateInboxForwarderOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateInboxForwarderOptions
* @throws IOException if the JSON string is invalid with respect to CreateInboxForwarderOptions
*/
public static CreateInboxForwarderOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateInboxForwarderOptions.class);
}
/**
* Convert an instance of CreateInboxForwarderOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating an inbox. An inbox has a real email address that can send and receive emails. Inboxes can be permanent or expire at a given time. Inboxes are either `SMTP` or `HTTP` mailboxes. `SMTP` inboxes are processed by a mail server running at `mailslurp.mx` while `HTTP` inboxes are processed by AWS SES backed mailservers. An inbox email address is randomly assigned by default ending in either `mailslurp.com` or (if `useDomainPool` is enabled) ending in a similar domain such as `mailslurp.xyz` (selected at random). To specify an address use a custom domain: either pass the `emailAddress` options with `<your-recipient>@<your-domain>`. To create a randomized address for your domain set the `domainName` to the domain you have verified or pass the `domainId`. Virtual inboxes prevent outbound sending and instead trap mail.
*/
@ApiModel(description = "Options for creating an inbox. An inbox has a real email address that can send and receive emails. Inboxes can be permanent or expire at a given time. Inboxes are either `SMTP` or `HTTP` mailboxes. `SMTP` inboxes are processed by a mail server running at `mailslurp.mx` while `HTTP` inboxes are processed by AWS SES backed mailservers. An inbox email address is randomly assigned by default ending in either `mailslurp.com` or (if `useDomainPool` is enabled) ending in a similar domain such as `mailslurp.xyz` (selected at random). To specify an address use a custom domain: either pass the `emailAddress` options with `<your-recipient>@<your-domain>`. To create a randomized address for your domain set the `domainName` to the domain you have verified or pass the `domainId`. Virtual inboxes prevent outbound sending and instead trap mail.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateInboxDto {
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_DOMAIN_NAME = "domainName";
@SerializedName(SERIALIZED_NAME_DOMAIN_NAME)
private String domainName;
public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId";
@SerializedName(SERIALIZED_NAME_DOMAIN_ID)
private UUID domainId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_USE_DOMAIN_POOL = "useDomainPool";
@SerializedName(SERIALIZED_NAME_USE_DOMAIN_POOL)
private Boolean useDomainPool;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt";
@SerializedName(SERIALIZED_NAME_EXPIRES_AT)
private OffsetDateTime expiresAt;
public static final String SERIALIZED_NAME_FAVOURITE = "favourite";
@SerializedName(SERIALIZED_NAME_FAVOURITE)
private Boolean favourite;
public static final String SERIALIZED_NAME_EXPIRES_IN = "expiresIn";
@SerializedName(SERIALIZED_NAME_EXPIRES_IN)
private Long expiresIn;
public static final String SERIALIZED_NAME_ALLOW_TEAM_ACCESS = "allowTeamAccess";
@SerializedName(SERIALIZED_NAME_ALLOW_TEAM_ACCESS)
private Boolean allowTeamAccess;
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
*/
@JsonAdapter(InboxTypeEnum.Adapter.class)
public enum InboxTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_INBOX("SMTP_INBOX");
private String value;
InboxTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static InboxTypeEnum fromValue(String value) {
for (InboxTypeEnum b : InboxTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<InboxTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final InboxTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public InboxTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return InboxTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_INBOX_TYPE = "inboxType";
@SerializedName(SERIALIZED_NAME_INBOX_TYPE)
private InboxTypeEnum inboxType;
public static final String SERIALIZED_NAME_VIRTUAL_INBOX = "virtualInbox";
@SerializedName(SERIALIZED_NAME_VIRTUAL_INBOX)
private Boolean virtualInbox;
public static final String SERIALIZED_NAME_USE_SHORT_ADDRESS = "useShortAddress";
@SerializedName(SERIALIZED_NAME_USE_SHORT_ADDRESS)
private Boolean useShortAddress;
public CreateInboxDto() {
}
public CreateInboxDto emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
* @return emailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public CreateInboxDto domainName(String domainName) {
this.domainName = domainName;
return this;
}
/**
* FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox.
* @return domainName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox.")
public String getDomainName() {
return domainName;
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public CreateInboxDto domainId(UUID domainId) {
this.domainId = domainId;
return this;
}
/**
* ID of custom domain to use for email address.
* @return domainId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of custom domain to use for email address.")
public UUID getDomainId() {
return domainId;
}
public void setDomainId(UUID domainId) {
this.domainId = domainId;
}
public CreateInboxDto name(String name) {
this.name = name;
return this;
}
/**
* Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails.
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails.")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateInboxDto description(String description) {
this.description = description;
return this;
}
/**
* Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public CreateInboxDto useDomainPool(Boolean useDomainPool) {
this.useDomainPool = useDomainPool;
return this;
}
/**
* Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types.
* @return useDomainPool
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types.")
public Boolean getUseDomainPool() {
return useDomainPool;
}
public void setUseDomainPool(Boolean useDomainPool) {
this.useDomainPool = useDomainPool;
}
public CreateInboxDto tags(List<String> tags) {
this.tags = tags;
return this;
}
public CreateInboxDto addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public CreateInboxDto expiresAt(OffsetDateTime expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX.
* @return expiresAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX.")
public OffsetDateTime getExpiresAt() {
return expiresAt;
}
public void setExpiresAt(OffsetDateTime expiresAt) {
this.expiresAt = expiresAt;
}
public CreateInboxDto favourite(Boolean favourite) {
this.favourite = favourite;
return this;
}
/**
* Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering
* @return favourite
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering")
public Boolean getFavourite() {
return favourite;
}
public void setFavourite(Boolean favourite) {
this.favourite = favourite;
}
public CreateInboxDto expiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
return this;
}
/**
* Number of milliseconds that inbox should exist for
* @return expiresIn
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Number of milliseconds that inbox should exist for")
public Long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
}
public CreateInboxDto allowTeamAccess(Boolean allowTeamAccess) {
this.allowTeamAccess = allowTeamAccess;
return this;
}
/**
* DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization.
* @return allowTeamAccess
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization.")
public Boolean getAllowTeamAccess() {
return allowTeamAccess;
}
public void setAllowTeamAccess(Boolean allowTeamAccess) {
this.allowTeamAccess = allowTeamAccess;
}
public CreateInboxDto inboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
return this;
}
/**
* Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
* @return inboxType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).")
public InboxTypeEnum getInboxType() {
return inboxType;
}
public void setInboxType(InboxTypeEnum inboxType) {
this.inboxType = inboxType;
}
public CreateInboxDto virtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
return this;
}
/**
* Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending.
* @return virtualInbox
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending.")
public Boolean getVirtualInbox() {
return virtualInbox;
}
public void setVirtualInbox(Boolean virtualInbox) {
this.virtualInbox = virtualInbox;
}
public CreateInboxDto useShortAddress(Boolean useShortAddress) {
this.useShortAddress = useShortAddress;
return this;
}
/**
* Use a shorter email address under 31 characters
* @return useShortAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Use a shorter email address under 31 characters")
public Boolean getUseShortAddress() {
return useShortAddress;
}
public void setUseShortAddress(Boolean useShortAddress) {
this.useShortAddress = useShortAddress;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateInboxDto createInboxDto = (CreateInboxDto) o;
return Objects.equals(this.emailAddress, createInboxDto.emailAddress) &&
Objects.equals(this.domainName, createInboxDto.domainName) &&
Objects.equals(this.domainId, createInboxDto.domainId) &&
Objects.equals(this.name, createInboxDto.name) &&
Objects.equals(this.description, createInboxDto.description) &&
Objects.equals(this.useDomainPool, createInboxDto.useDomainPool) &&
Objects.equals(this.tags, createInboxDto.tags) &&
Objects.equals(this.expiresAt, createInboxDto.expiresAt) &&
Objects.equals(this.favourite, createInboxDto.favourite) &&
Objects.equals(this.expiresIn, createInboxDto.expiresIn) &&
Objects.equals(this.allowTeamAccess, createInboxDto.allowTeamAccess) &&
Objects.equals(this.inboxType, createInboxDto.inboxType) &&
Objects.equals(this.virtualInbox, createInboxDto.virtualInbox) &&
Objects.equals(this.useShortAddress, createInboxDto.useShortAddress);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(emailAddress, domainName, domainId, name, description, useDomainPool, tags, expiresAt, favourite, expiresIn, allowTeamAccess, inboxType, virtualInbox, useShortAddress);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateInboxDto {\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n");
sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" useDomainPool: ").append(toIndentedString(useDomainPool)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
sb.append(" favourite: ").append(toIndentedString(favourite)).append("\n");
sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n");
sb.append(" allowTeamAccess: ").append(toIndentedString(allowTeamAccess)).append("\n");
sb.append(" inboxType: ").append(toIndentedString(inboxType)).append("\n");
sb.append(" virtualInbox: ").append(toIndentedString(virtualInbox)).append("\n");
sb.append(" useShortAddress: ").append(toIndentedString(useShortAddress)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("emailAddress");
openapiFields.add("domainName");
openapiFields.add("domainId");
openapiFields.add("name");
openapiFields.add("description");
openapiFields.add("useDomainPool");
openapiFields.add("tags");
openapiFields.add("expiresAt");
openapiFields.add("favourite");
openapiFields.add("expiresIn");
openapiFields.add("allowTeamAccess");
openapiFields.add("inboxType");
openapiFields.add("virtualInbox");
openapiFields.add("useShortAddress");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateInboxDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateInboxDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInboxDto is not found in the empty JSON string", CreateInboxDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateInboxDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInboxDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("emailAddress") != null && !jsonObj.get("emailAddress").isJsonNull()) && !jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("domainName") != null && !jsonObj.get("domainName").isJsonNull()) && !jsonObj.get("domainName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainName").toString()));
}
if ((jsonObj.get("domainId") != null && !jsonObj.get("domainId").isJsonNull()) && !jsonObj.get("domainId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
if ((jsonObj.get("inboxType") != null && !jsonObj.get("inboxType").isJsonNull()) && !jsonObj.get("inboxType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateInboxDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateInboxDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateInboxDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateInboxDto.class));
return (TypeAdapter<T>) new TypeAdapter<CreateInboxDto>() {
@Override
public void write(JsonWriter out, CreateInboxDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateInboxDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateInboxDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateInboxDto
* @throws IOException if the JSON string is invalid with respect to CreateInboxDto
*/
public static CreateInboxDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateInboxDto.class);
}
/**
* Convert an instance of CreateInboxDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Create contact group options
*/
@ApiModel(description = "Create contact group options")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateGroupOptions {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public CreateGroupOptions() {
}
public CreateGroupOptions name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateGroupOptions description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateGroupOptions createGroupOptions = (CreateGroupOptions) o;
return Objects.equals(this.name, createGroupOptions.name) &&
Objects.equals(this.description, createGroupOptions.description);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(name, description);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateGroupOptions {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("description");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateGroupOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateGroupOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateGroupOptions is not found in the empty JSON string", CreateGroupOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateGroupOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateGroupOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateGroupOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateGroupOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateGroupOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateGroupOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateGroupOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateGroupOptions>() {
@Override
public void write(JsonWriter out, CreateGroupOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateGroupOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateGroupOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateGroupOptions
* @throws IOException if the JSON string is invalid with respect to CreateGroupOptions
*/
public static CreateGroupOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateGroupOptions.class);
}
/**
* Convert an instance of CreateGroupOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* CreateEmergencyAddressOptions
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateEmergencyAddressOptions {
public static final String SERIALIZED_NAME_CUSTOMER_NAME = "customerName";
@SerializedName(SERIALIZED_NAME_CUSTOMER_NAME)
private String customerName;
public static final String SERIALIZED_NAME_ADDRESS1 = "address1";
@SerializedName(SERIALIZED_NAME_ADDRESS1)
private String address1;
public static final String SERIALIZED_NAME_CITY = "city";
@SerializedName(SERIALIZED_NAME_CITY)
private String city;
public static final String SERIALIZED_NAME_REGION = "region";
@SerializedName(SERIALIZED_NAME_REGION)
private String region;
public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode";
@SerializedName(SERIALIZED_NAME_POSTAL_CODE)
private String postalCode;
/**
* Gets or Sets isoCountryCode
*/
@JsonAdapter(IsoCountryCodeEnum.Adapter.class)
public enum IsoCountryCodeEnum {
US("US"),
GB("GB"),
AU("AU");
private String value;
IsoCountryCodeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static IsoCountryCodeEnum fromValue(String value) {
for (IsoCountryCodeEnum b : IsoCountryCodeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<IsoCountryCodeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final IsoCountryCodeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public IsoCountryCodeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return IsoCountryCodeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ISO_COUNTRY_CODE = "isoCountryCode";
@SerializedName(SERIALIZED_NAME_ISO_COUNTRY_CODE)
private IsoCountryCodeEnum isoCountryCode;
public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName";
@SerializedName(SERIALIZED_NAME_DISPLAY_NAME)
private String displayName;
public CreateEmergencyAddressOptions() {
}
public CreateEmergencyAddressOptions customerName(String customerName) {
this.customerName = customerName;
return this;
}
/**
* Get customerName
* @return customerName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public CreateEmergencyAddressOptions address1(String address1) {
this.address1 = address1;
return this;
}
/**
* Get address1
* @return address1
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public CreateEmergencyAddressOptions city(String city) {
this.city = city;
return this;
}
/**
* Get city
* @return city
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public CreateEmergencyAddressOptions region(String region) {
this.region = region;
return this;
}
/**
* Get region
* @return region
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public CreateEmergencyAddressOptions postalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/**
* Get postalCode
* @return postalCode
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public CreateEmergencyAddressOptions isoCountryCode(IsoCountryCodeEnum isoCountryCode) {
this.isoCountryCode = isoCountryCode;
return this;
}
/**
* Get isoCountryCode
* @return isoCountryCode
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public IsoCountryCodeEnum getIsoCountryCode() {
return isoCountryCode;
}
public void setIsoCountryCode(IsoCountryCodeEnum isoCountryCode) {
this.isoCountryCode = isoCountryCode;
}
public CreateEmergencyAddressOptions displayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* Get displayName
* @return displayName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateEmergencyAddressOptions createEmergencyAddressOptions = (CreateEmergencyAddressOptions) o;
return Objects.equals(this.customerName, createEmergencyAddressOptions.customerName) &&
Objects.equals(this.address1, createEmergencyAddressOptions.address1) &&
Objects.equals(this.city, createEmergencyAddressOptions.city) &&
Objects.equals(this.region, createEmergencyAddressOptions.region) &&
Objects.equals(this.postalCode, createEmergencyAddressOptions.postalCode) &&
Objects.equals(this.isoCountryCode, createEmergencyAddressOptions.isoCountryCode) &&
Objects.equals(this.displayName, createEmergencyAddressOptions.displayName);
}
@Override
public int hashCode() {
return Objects.hash(customerName, address1, city, region, postalCode, isoCountryCode, displayName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateEmergencyAddressOptions {\n");
sb.append(" customerName: ").append(toIndentedString(customerName)).append("\n");
sb.append(" address1: ").append(toIndentedString(address1)).append("\n");
sb.append(" city: ").append(toIndentedString(city)).append("\n");
sb.append(" region: ").append(toIndentedString(region)).append("\n");
sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n");
sb.append(" isoCountryCode: ").append(toIndentedString(isoCountryCode)).append("\n");
sb.append(" displayName: ").append(toIndentedString(displayName)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("customerName");
openapiFields.add("address1");
openapiFields.add("city");
openapiFields.add("region");
openapiFields.add("postalCode");
openapiFields.add("isoCountryCode");
openapiFields.add("displayName");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("customerName");
openapiRequiredFields.add("address1");
openapiRequiredFields.add("city");
openapiRequiredFields.add("region");
openapiRequiredFields.add("postalCode");
openapiRequiredFields.add("isoCountryCode");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateEmergencyAddressOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateEmergencyAddressOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEmergencyAddressOptions is not found in the empty JSON string", CreateEmergencyAddressOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateEmergencyAddressOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEmergencyAddressOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateEmergencyAddressOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("customerName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `customerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerName").toString()));
}
if (!jsonObj.get("address1").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address1").toString()));
}
if (!jsonObj.get("city").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString()));
}
if (!jsonObj.get("region").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString()));
}
if (!jsonObj.get("postalCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postalCode").toString()));
}
if (!jsonObj.get("isoCountryCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `isoCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isoCountryCode").toString()));
}
if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) && !jsonObj.get("displayName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateEmergencyAddressOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateEmergencyAddressOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateEmergencyAddressOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateEmergencyAddressOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateEmergencyAddressOptions>() {
@Override
public void write(JsonWriter out, CreateEmergencyAddressOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateEmergencyAddressOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateEmergencyAddressOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateEmergencyAddressOptions
* @throws IOException if the JSON string is invalid with respect to CreateEmergencyAddressOptions
*/
public static CreateEmergencyAddressOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateEmergencyAddressOptions.class);
}
/**
* Convert an instance of CreateEmergencyAddressOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not function correctly until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help. Domains can be either `HTTP` or `SMTP` type. The type of domain determines which inboxes can be used with it. `SMTP` inboxes use a mail server running `mx.mailslurp.com` while `HTTP` inboxes are handled by AWS SES.
*/
@ApiModel(description = "Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not function correctly until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help. Domains can be either `HTTP` or `SMTP` type. The type of domain determines which inboxes can be used with it. `SMTP` inboxes use a mail server running `mx.mailslurp.com` while `HTTP` inboxes are handled by AWS SES.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateDomainOptions {
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_CREATED_CATCH_ALL_INBOX = "createdCatchAllInbox";
@SerializedName(SERIALIZED_NAME_CREATED_CATCH_ALL_INBOX)
private Boolean createdCatchAllInbox;
/**
* Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
*/
@JsonAdapter(DomainTypeEnum.Adapter.class)
public enum DomainTypeEnum {
HTTP_INBOX("HTTP_INBOX"),
SMTP_DOMAIN("SMTP_DOMAIN");
private String value;
DomainTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static DomainTypeEnum fromValue(String value) {
for (DomainTypeEnum b : DomainTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<DomainTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final DomainTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public DomainTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return DomainTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_DOMAIN_TYPE = "domainType";
@SerializedName(SERIALIZED_NAME_DOMAIN_TYPE)
private DomainTypeEnum domainType;
public CreateDomainOptions() {
}
public CreateDomainOptions domain(String domain) {
this.domain = domain;
return this;
}
/**
* The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain.
* @return domain
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain.")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public CreateDomainOptions description(String description) {
this.description = description;
return this;
}
/**
* Optional description of the domain.
* @return description
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional description of the domain.")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public CreateDomainOptions createdCatchAllInbox(Boolean createdCatchAllInbox) {
this.createdCatchAllInbox = createdCatchAllInbox;
return this;
}
/**
* Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID.
* @return createdCatchAllInbox
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID.")
public Boolean getCreatedCatchAllInbox() {
return createdCatchAllInbox;
}
public void setCreatedCatchAllInbox(Boolean createdCatchAllInbox) {
this.createdCatchAllInbox = createdCatchAllInbox;
}
public CreateDomainOptions domainType(DomainTypeEnum domainType) {
this.domainType = domainType;
return this;
}
/**
* Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
* @return domainType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.")
public DomainTypeEnum getDomainType() {
return domainType;
}
public void setDomainType(DomainTypeEnum domainType) {
this.domainType = domainType;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateDomainOptions createDomainOptions = (CreateDomainOptions) o;
return Objects.equals(this.domain, createDomainOptions.domain) &&
Objects.equals(this.description, createDomainOptions.description) &&
Objects.equals(this.createdCatchAllInbox, createDomainOptions.createdCatchAllInbox) &&
Objects.equals(this.domainType, createDomainOptions.domainType);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(domain, description, createdCatchAllInbox, domainType);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateDomainOptions {\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" createdCatchAllInbox: ").append(toIndentedString(createdCatchAllInbox)).append("\n");
sb.append(" domainType: ").append(toIndentedString(domainType)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("domain");
openapiFields.add("description");
openapiFields.add("createdCatchAllInbox");
openapiFields.add("domainType");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("domain");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateDomainOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateDomainOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDomainOptions is not found in the empty JSON string", CreateDomainOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateDomainOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDomainOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateDomainOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("domain").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
if ((jsonObj.get("domainType") != null && !jsonObj.get("domainType").isJsonNull()) && !jsonObj.get("domainType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `domainType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateDomainOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateDomainOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateDomainOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateDomainOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateDomainOptions>() {
@Override
public void write(JsonWriter out, CreateDomainOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateDomainOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateDomainOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateDomainOptions
* @throws IOException if the JSON string is invalid with respect to CreateDomainOptions
*/
public static CreateDomainOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateDomainOptions.class);
}
/**
* Convert an instance of CreateDomainOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for creating an email contact in address book
*/
@ApiModel(description = "Options for creating an email contact in address book")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateContactOptions {
public static final String SERIALIZED_NAME_FIRST_NAME = "firstName";
@SerializedName(SERIALIZED_NAME_FIRST_NAME)
private String firstName;
public static final String SERIALIZED_NAME_LAST_NAME = "lastName";
@SerializedName(SERIALIZED_NAME_LAST_NAME)
private String lastName;
public static final String SERIALIZED_NAME_COMPANY = "company";
@SerializedName(SERIALIZED_NAME_COMPANY)
private String company;
public static final String SERIALIZED_NAME_EMAIL_ADDRESSES = "emailAddresses";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESSES)
private List<String> emailAddresses = null;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
public static final String SERIALIZED_NAME_META_DATA = "metaData";
@SerializedName(SERIALIZED_NAME_META_DATA)
private Object metaData;
public static final String SERIALIZED_NAME_OPT_OUT = "optOut";
@SerializedName(SERIALIZED_NAME_OPT_OUT)
private Boolean optOut;
public static final String SERIALIZED_NAME_GROUP_ID = "groupId";
@SerializedName(SERIALIZED_NAME_GROUP_ID)
private UUID groupId;
public CreateContactOptions() {
}
public CreateContactOptions firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
* @return firstName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public CreateContactOptions lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
* @return lastName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public CreateContactOptions company(String company) {
this.company = company;
return this;
}
/**
* Get company
* @return company
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public CreateContactOptions emailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
return this;
}
public CreateContactOptions addEmailAddressesItem(String emailAddressesItem) {
if (this.emailAddresses == null) {
this.emailAddresses = new ArrayList<>();
}
this.emailAddresses.add(emailAddressesItem);
return this;
}
/**
* Set of email addresses belonging to the contact
* @return emailAddresses
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Set of email addresses belonging to the contact")
public List<String> getEmailAddresses() {
return emailAddresses;
}
public void setEmailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
}
public CreateContactOptions tags(List<String> tags) {
this.tags = tags;
return this;
}
public CreateContactOptions addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Tags that can be used to search and group contacts
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Tags that can be used to search and group contacts")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public CreateContactOptions metaData(Object metaData) {
this.metaData = metaData;
return this;
}
/**
* Get metaData
* @return metaData
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Object getMetaData() {
return metaData;
}
public void setMetaData(Object metaData) {
this.metaData = metaData;
}
public CreateContactOptions optOut(Boolean optOut) {
this.optOut = optOut;
return this;
}
/**
* Has the user explicitly or implicitly opted out of being contacted? If so MailSlurp will ignore them in all actions.
* @return optOut
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Has the user explicitly or implicitly opted out of being contacted? If so MailSlurp will ignore them in all actions.")
public Boolean getOptOut() {
return optOut;
}
public void setOptOut(Boolean optOut) {
this.optOut = optOut;
}
public CreateContactOptions groupId(UUID groupId) {
this.groupId = groupId;
return this;
}
/**
* Group IDs that contact belongs to
* @return groupId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Group IDs that contact belongs to")
public UUID getGroupId() {
return groupId;
}
public void setGroupId(UUID groupId) {
this.groupId = groupId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateContactOptions createContactOptions = (CreateContactOptions) o;
return Objects.equals(this.firstName, createContactOptions.firstName) &&
Objects.equals(this.lastName, createContactOptions.lastName) &&
Objects.equals(this.company, createContactOptions.company) &&
Objects.equals(this.emailAddresses, createContactOptions.emailAddresses) &&
Objects.equals(this.tags, createContactOptions.tags) &&
Objects.equals(this.metaData, createContactOptions.metaData) &&
Objects.equals(this.optOut, createContactOptions.optOut) &&
Objects.equals(this.groupId, createContactOptions.groupId);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(firstName, lastName, company, emailAddresses, tags, metaData, optOut, groupId);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateContactOptions {\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" company: ").append(toIndentedString(company)).append("\n");
sb.append(" emailAddresses: ").append(toIndentedString(emailAddresses)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" metaData: ").append(toIndentedString(metaData)).append("\n");
sb.append(" optOut: ").append(toIndentedString(optOut)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("firstName");
openapiFields.add("lastName");
openapiFields.add("company");
openapiFields.add("emailAddresses");
openapiFields.add("tags");
openapiFields.add("metaData");
openapiFields.add("optOut");
openapiFields.add("groupId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateContactOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateContactOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateContactOptions is not found in the empty JSON string", CreateContactOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateContactOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateContactOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonNull()) && !jsonObj.get("firstName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString()));
}
if ((jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonNull()) && !jsonObj.get("lastName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString()));
}
if ((jsonObj.get("company") != null && !jsonObj.get("company").isJsonNull()) && !jsonObj.get("company").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("emailAddresses") != null && !jsonObj.get("emailAddresses").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("emailAddresses").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
if ((jsonObj.get("groupId") != null && !jsonObj.get("groupId").isJsonNull()) && !jsonObj.get("groupId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `groupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateContactOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateContactOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateContactOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateContactOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateContactOptions>() {
@Override
public void write(JsonWriter out, CreateContactOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateContactOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateContactOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateContactOptions
* @throws IOException if the JSON string is invalid with respect to CreateContactOptions
*/
public static CreateContactOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateContactOptions.class);
}
/**
* Convert an instance of CreateContactOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.CreateConnectorImapOptions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* CreateConnectorOptions
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateConnectorOptions {
/**
* Gets or Sets connectorType
*/
@JsonAdapter(ConnectorTypeEnum.Adapter.class)
public enum ConnectorTypeEnum {
IMAP("IMAP");
private String value;
ConnectorTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ConnectorTypeEnum fromValue(String value) {
for (ConnectorTypeEnum b : ConnectorTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ConnectorTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ConnectorTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ConnectorTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ConnectorTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_CONNECTOR_TYPE = "connectorType";
@SerializedName(SERIALIZED_NAME_CONNECTOR_TYPE)
private ConnectorTypeEnum connectorType;
/**
* Gets or Sets connectorAuthType
*/
@JsonAdapter(ConnectorAuthTypeEnum.Adapter.class)
public enum ConnectorAuthTypeEnum {
PLAIN_TEXT("PLAIN_TEXT");
private String value;
ConnectorAuthTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ConnectorAuthTypeEnum fromValue(String value) {
for (ConnectorAuthTypeEnum b : ConnectorAuthTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ConnectorAuthTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ConnectorAuthTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ConnectorAuthTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ConnectorAuthTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_CONNECTOR_AUTH_TYPE = "connectorAuthType";
@SerializedName(SERIALIZED_NAME_CONNECTOR_AUTH_TYPE)
private ConnectorAuthTypeEnum connectorAuthType;
public static final String SERIALIZED_NAME_IMAP_SETTINGS = "imapSettings";
@SerializedName(SERIALIZED_NAME_IMAP_SETTINGS)
private CreateConnectorImapOptions imapSettings;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_SYNC_ENABLED = "syncEnabled";
@SerializedName(SERIALIZED_NAME_SYNC_ENABLED)
private Boolean syncEnabled;
/**
* Gets or Sets syncScheduleType
*/
@JsonAdapter(SyncScheduleTypeEnum.Adapter.class)
public enum SyncScheduleTypeEnum {
INTERVAL("INTERVAL");
private String value;
SyncScheduleTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SyncScheduleTypeEnum fromValue(String value) {
for (SyncScheduleTypeEnum b : SyncScheduleTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SyncScheduleTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SyncScheduleTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SyncScheduleTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SyncScheduleTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SYNC_SCHEDULE_TYPE = "syncScheduleType";
@SerializedName(SERIALIZED_NAME_SYNC_SCHEDULE_TYPE)
private SyncScheduleTypeEnum syncScheduleType;
public static final String SERIALIZED_NAME_SYNC_INTERVAL = "syncInterval";
@SerializedName(SERIALIZED_NAME_SYNC_INTERVAL)
private Integer syncInterval;
public CreateConnectorOptions() {
}
public CreateConnectorOptions connectorType(ConnectorTypeEnum connectorType) {
this.connectorType = connectorType;
return this;
}
/**
* Get connectorType
* @return connectorType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ConnectorTypeEnum getConnectorType() {
return connectorType;
}
public void setConnectorType(ConnectorTypeEnum connectorType) {
this.connectorType = connectorType;
}
public CreateConnectorOptions connectorAuthType(ConnectorAuthTypeEnum connectorAuthType) {
this.connectorAuthType = connectorAuthType;
return this;
}
/**
* Get connectorAuthType
* @return connectorAuthType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ConnectorAuthTypeEnum getConnectorAuthType() {
return connectorAuthType;
}
public void setConnectorAuthType(ConnectorAuthTypeEnum connectorAuthType) {
this.connectorAuthType = connectorAuthType;
}
public CreateConnectorOptions imapSettings(CreateConnectorImapOptions imapSettings) {
this.imapSettings = imapSettings;
return this;
}
/**
* Get imapSettings
* @return imapSettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public CreateConnectorImapOptions getImapSettings() {
return imapSettings;
}
public void setImapSettings(CreateConnectorImapOptions imapSettings) {
this.imapSettings = imapSettings;
}
public CreateConnectorOptions inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public CreateConnectorOptions syncEnabled(Boolean syncEnabled) {
this.syncEnabled = syncEnabled;
return this;
}
/**
* Get syncEnabled
* @return syncEnabled
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSyncEnabled() {
return syncEnabled;
}
public void setSyncEnabled(Boolean syncEnabled) {
this.syncEnabled = syncEnabled;
}
public CreateConnectorOptions syncScheduleType(SyncScheduleTypeEnum syncScheduleType) {
this.syncScheduleType = syncScheduleType;
return this;
}
/**
* Get syncScheduleType
* @return syncScheduleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public SyncScheduleTypeEnum getSyncScheduleType() {
return syncScheduleType;
}
public void setSyncScheduleType(SyncScheduleTypeEnum syncScheduleType) {
this.syncScheduleType = syncScheduleType;
}
public CreateConnectorOptions syncInterval(Integer syncInterval) {
this.syncInterval = syncInterval;
return this;
}
/**
* Get syncInterval
* @return syncInterval
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSyncInterval() {
return syncInterval;
}
public void setSyncInterval(Integer syncInterval) {
this.syncInterval = syncInterval;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateConnectorOptions createConnectorOptions = (CreateConnectorOptions) o;
return Objects.equals(this.connectorType, createConnectorOptions.connectorType) &&
Objects.equals(this.connectorAuthType, createConnectorOptions.connectorAuthType) &&
Objects.equals(this.imapSettings, createConnectorOptions.imapSettings) &&
Objects.equals(this.inboxId, createConnectorOptions.inboxId) &&
Objects.equals(this.syncEnabled, createConnectorOptions.syncEnabled) &&
Objects.equals(this.syncScheduleType, createConnectorOptions.syncScheduleType) &&
Objects.equals(this.syncInterval, createConnectorOptions.syncInterval);
}
@Override
public int hashCode() {
return Objects.hash(connectorType, connectorAuthType, imapSettings, inboxId, syncEnabled, syncScheduleType, syncInterval);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateConnectorOptions {\n");
sb.append(" connectorType: ").append(toIndentedString(connectorType)).append("\n");
sb.append(" connectorAuthType: ").append(toIndentedString(connectorAuthType)).append("\n");
sb.append(" imapSettings: ").append(toIndentedString(imapSettings)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).append("\n");
sb.append(" syncScheduleType: ").append(toIndentedString(syncScheduleType)).append("\n");
sb.append(" syncInterval: ").append(toIndentedString(syncInterval)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("connectorType");
openapiFields.add("connectorAuthType");
openapiFields.add("imapSettings");
openapiFields.add("inboxId");
openapiFields.add("syncEnabled");
openapiFields.add("syncScheduleType");
openapiFields.add("syncInterval");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("connectorType");
openapiRequiredFields.add("connectorAuthType");
openapiRequiredFields.add("syncEnabled");
openapiRequiredFields.add("syncScheduleType");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateConnectorOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateConnectorOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateConnectorOptions is not found in the empty JSON string", CreateConnectorOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateConnectorOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateConnectorOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateConnectorOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("connectorType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorType").toString()));
}
if (!jsonObj.get("connectorAuthType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorAuthType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorAuthType").toString()));
}
// validate the optional field `imapSettings`
if (jsonObj.get("imapSettings") != null && !jsonObj.get("imapSettings").isJsonNull()) {
CreateConnectorImapOptions.validateJsonObject(jsonObj.getAsJsonObject("imapSettings"));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("syncScheduleType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `syncScheduleType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("syncScheduleType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateConnectorOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateConnectorOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateConnectorOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateConnectorOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateConnectorOptions>() {
@Override
public void write(JsonWriter out, CreateConnectorOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateConnectorOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateConnectorOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateConnectorOptions
* @throws IOException if the JSON string is invalid with respect to CreateConnectorOptions
*/
public static CreateConnectorOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateConnectorOptions.class);
}
/**
* Convert an instance of CreateConnectorOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* CreateConnectorImapOptions
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateConnectorImapOptions {
public static final String SERIALIZED_NAME_HOST = "host";
@SerializedName(SERIALIZED_NAME_HOST)
private String host;
public static final String SERIALIZED_NAME_PORT = "port";
@SerializedName(SERIALIZED_NAME_PORT)
private Integer port;
public static final String SERIALIZED_NAME_USERNAME = "username";
@SerializedName(SERIALIZED_NAME_USERNAME)
private String username;
public static final String SERIALIZED_NAME_PASSWORD = "password";
@SerializedName(SERIALIZED_NAME_PASSWORD)
private String password;
public static final String SERIALIZED_NAME_USE_S_S_L = "useSSL";
@SerializedName(SERIALIZED_NAME_USE_S_S_L)
private Boolean useSSL;
public CreateConnectorImapOptions() {
}
public CreateConnectorImapOptions host(String host) {
this.host = host;
return this;
}
/**
* Get host
* @return host
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public CreateConnectorImapOptions port(Integer port) {
this.port = port;
return this;
}
/**
* Get port
* @return port
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public CreateConnectorImapOptions username(String username) {
this.username = username;
return this;
}
/**
* Get username
* @return username
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public CreateConnectorImapOptions password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public CreateConnectorImapOptions useSSL(Boolean useSSL) {
this.useSSL = useSSL;
return this;
}
/**
* Get useSSL
* @return useSSL
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getUseSSL() {
return useSSL;
}
public void setUseSSL(Boolean useSSL) {
this.useSSL = useSSL;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateConnectorImapOptions createConnectorImapOptions = (CreateConnectorImapOptions) o;
return Objects.equals(this.host, createConnectorImapOptions.host) &&
Objects.equals(this.port, createConnectorImapOptions.port) &&
Objects.equals(this.username, createConnectorImapOptions.username) &&
Objects.equals(this.password, createConnectorImapOptions.password) &&
Objects.equals(this.useSSL, createConnectorImapOptions.useSSL);
}
@Override
public int hashCode() {
return Objects.hash(host, port, username, password, useSSL);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateConnectorImapOptions {\n");
sb.append(" host: ").append(toIndentedString(host)).append("\n");
sb.append(" port: ").append(toIndentedString(port)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" useSSL: ").append(toIndentedString(useSSL)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("host");
openapiFields.add("port");
openapiFields.add("username");
openapiFields.add("password");
openapiFields.add("useSSL");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("host");
openapiRequiredFields.add("port");
openapiRequiredFields.add("username");
openapiRequiredFields.add("password");
openapiRequiredFields.add("useSSL");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateConnectorImapOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateConnectorImapOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateConnectorImapOptions is not found in the empty JSON string", CreateConnectorImapOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateConnectorImapOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateConnectorImapOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateConnectorImapOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("host").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString()));
}
if (!jsonObj.get("username").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString()));
}
if (!jsonObj.get("password").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateConnectorImapOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateConnectorImapOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateConnectorImapOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateConnectorImapOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateConnectorImapOptions>() {
@Override
public void write(JsonWriter out, CreateConnectorImapOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateConnectorImapOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateConnectorImapOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateConnectorImapOptions
* @throws IOException if the JSON string is invalid with respect to CreateConnectorImapOptions
*/
public static CreateConnectorImapOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateConnectorImapOptions.class);
}
/**
* Convert an instance of CreateConnectorImapOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Create email alias options. Email aliases can be used to mask real email addresses behind an ID. You can also attach an inbox to an alias so that any email received by the inbox email address if forwarded to the alias email address.
*/
@ApiModel(description = "Create email alias options. Email aliases can be used to mask real email addresses behind an ID. You can also attach an inbox to an alias so that any email received by the inbox email address if forwarded to the alias email address.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CreateAliasOptions {
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_USE_THREADS = "useThreads";
@SerializedName(SERIALIZED_NAME_USE_THREADS)
private Boolean useThreads;
public CreateAliasOptions() {
}
public CreateAliasOptions emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Email address to be hidden behind alias. Emails sent to the alias email address will be forwarded to this address. If you want to enable replies set useThreads true and the reply-to for the email will allow outbound communication via a thread. Some email addresses may require verification if they are not added as a contact first.
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Email address to be hidden behind alias. Emails sent to the alias email address will be forwarded to this address. If you want to enable replies set useThreads true and the reply-to for the email will allow outbound communication via a thread. Some email addresses may require verification if they are not added as a contact first.")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public CreateAliasOptions inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Optional inbox ID to attach to alias. Null by default means an a new inbox will be created for the alias. Use a custom inbox to control what email address the alias uses. To use custom email addresses create a domain and an inbox, the use the inbox ID with this call. Emails received by this inbox will be forwarded to the alias email address
* @return inboxId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional inbox ID to attach to alias. Null by default means an a new inbox will be created for the alias. Use a custom inbox to control what email address the alias uses. To use custom email addresses create a domain and an inbox, the use the inbox ID with this call. Emails received by this inbox will be forwarded to the alias email address")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public CreateAliasOptions name(String name) {
this.name = name;
return this;
}
/**
* Optional name for alias
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Optional name for alias")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CreateAliasOptions useThreads(Boolean useThreads) {
this.useThreads = useThreads;
return this;
}
/**
* Enable threads options. If true emails will be sent with a unique reply-to thread address. This means you can reply to the forwarded email and it will be sent to the recipients via your alias address. That way a thread conversation is preserved.
* @return useThreads
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Enable threads options. If true emails will be sent with a unique reply-to thread address. This means you can reply to the forwarded email and it will be sent to the recipients via your alias address. That way a thread conversation is preserved.")
public Boolean getUseThreads() {
return useThreads;
}
public void setUseThreads(Boolean useThreads) {
this.useThreads = useThreads;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateAliasOptions createAliasOptions = (CreateAliasOptions) o;
return Objects.equals(this.emailAddress, createAliasOptions.emailAddress) &&
Objects.equals(this.inboxId, createAliasOptions.inboxId) &&
Objects.equals(this.name, createAliasOptions.name) &&
Objects.equals(this.useThreads, createAliasOptions.useThreads);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(emailAddress, inboxId, name, useThreads);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateAliasOptions {\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" useThreads: ").append(toIndentedString(useThreads)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("emailAddress");
openapiFields.add("inboxId");
openapiFields.add("name");
openapiFields.add("useThreads");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("useThreads");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CreateAliasOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CreateAliasOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAliasOptions is not found in the empty JSON string", CreateAliasOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CreateAliasOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAliasOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateAliasOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("inboxId") != null && !jsonObj.get("inboxId").isJsonNull()) && !jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreateAliasOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreateAliasOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreateAliasOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreateAliasOptions.class));
return (TypeAdapter<T>) new TypeAdapter<CreateAliasOptions>() {
@Override
public void write(JsonWriter out, CreateAliasOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreateAliasOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CreateAliasOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreateAliasOptions
* @throws IOException if the JSON string is invalid with respect to CreateAliasOptions
*/
public static CreateAliasOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreateAliasOptions.class);
}
/**
* Convert an instance of CreateAliasOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Number of elements
*/
@ApiModel(description = "Number of elements")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class CountDto {
public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements";
@SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS)
private Long totalElements;
public CountDto() {
}
public CountDto totalElements(Long totalElements) {
this.totalElements = totalElements;
return this;
}
/**
* Get totalElements
* @return totalElements
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getTotalElements() {
return totalElements;
}
public void setTotalElements(Long totalElements) {
this.totalElements = totalElements;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CountDto countDto = (CountDto) o;
return Objects.equals(this.totalElements, countDto.totalElements);
}
@Override
public int hashCode() {
return Objects.hash(totalElements);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CountDto {\n");
sb.append(" totalElements: ").append(toIndentedString(totalElements)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("totalElements");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("totalElements");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to CountDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!CountDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CountDto is not found in the empty JSON string", CountDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!CountDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CountDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CountDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CountDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CountDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CountDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CountDto.class));
return (TypeAdapter<T>) new TypeAdapter<CountDto>() {
@Override
public void write(JsonWriter out, CountDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CountDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of CountDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of CountDto
* @throws IOException if the JSON string is invalid with respect to CountDto
*/
public static CountDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CountDto.class);
}
/**
* Convert an instance of CountDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for matching content using regex patterns based on Java Pattern syntax
*/
@ApiModel(description = "Options for matching content using regex patterns based on Java Pattern syntax")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ContentMatchOptions {
public static final String SERIALIZED_NAME_PATTERN = "pattern";
@SerializedName(SERIALIZED_NAME_PATTERN)
private String pattern;
public ContentMatchOptions() {
}
public ContentMatchOptions pattern(String pattern) {
this.pattern = pattern;
return this;
}
/**
* Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
* @return pattern
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.")
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContentMatchOptions contentMatchOptions = (ContentMatchOptions) o;
return Objects.equals(this.pattern, contentMatchOptions.pattern);
}
@Override
public int hashCode() {
return Objects.hash(pattern);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContentMatchOptions {\n");
sb.append(" pattern: ").append(toIndentedString(pattern)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("pattern");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("pattern");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ContentMatchOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ContentMatchOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ContentMatchOptions is not found in the empty JSON string", ContentMatchOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ContentMatchOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ContentMatchOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ContentMatchOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("pattern").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `pattern` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pattern").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ContentMatchOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ContentMatchOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ContentMatchOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ContentMatchOptions.class));
return (TypeAdapter<T>) new TypeAdapter<ContentMatchOptions>() {
@Override
public void write(JsonWriter out, ContentMatchOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ContentMatchOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ContentMatchOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of ContentMatchOptions
* @throws IOException if the JSON string is invalid with respect to ContentMatchOptions
*/
public static ContentMatchOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ContentMatchOptions.class);
}
/**
* Convert an instance of ContentMatchOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email contact for address book
*/
@ApiModel(description = "Email contact for address book")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ContactProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_GROUP_ID = "groupId";
@SerializedName(SERIALIZED_NAME_GROUP_ID)
private UUID groupId;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_FIRST_NAME = "firstName";
@SerializedName(SERIALIZED_NAME_FIRST_NAME)
private String firstName;
public static final String SERIALIZED_NAME_LAST_NAME = "lastName";
@SerializedName(SERIALIZED_NAME_LAST_NAME)
private String lastName;
public static final String SERIALIZED_NAME_COMPANY = "company";
@SerializedName(SERIALIZED_NAME_COMPANY)
private String company;
public static final String SERIALIZED_NAME_EMAIL_ADDRESSES = "emailAddresses";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESSES)
private List<String> emailAddresses = null;
public static final String SERIALIZED_NAME_OPT_OUT = "optOut";
@SerializedName(SERIALIZED_NAME_OPT_OUT)
private Boolean optOut;
public ContactProjection() {
}
public ContactProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ContactProjection groupId(UUID groupId) {
this.groupId = groupId;
return this;
}
/**
* Get groupId
* @return groupId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getGroupId() {
return groupId;
}
public void setGroupId(UUID groupId) {
this.groupId = groupId;
}
public ContactProjection emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public ContactProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ContactProjection firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
* @return firstName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public ContactProjection lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
* @return lastName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public ContactProjection company(String company) {
this.company = company;
return this;
}
/**
* Get company
* @return company
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public ContactProjection emailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
return this;
}
public ContactProjection addEmailAddressesItem(String emailAddressesItem) {
if (this.emailAddresses == null) {
this.emailAddresses = new ArrayList<>();
}
this.emailAddresses.add(emailAddressesItem);
return this;
}
/**
* Get emailAddresses
* @return emailAddresses
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getEmailAddresses() {
return emailAddresses;
}
public void setEmailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
}
public ContactProjection optOut(Boolean optOut) {
this.optOut = optOut;
return this;
}
/**
* Get optOut
* @return optOut
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getOptOut() {
return optOut;
}
public void setOptOut(Boolean optOut) {
this.optOut = optOut;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContactProjection contactProjection = (ContactProjection) o;
return Objects.equals(this.id, contactProjection.id) &&
Objects.equals(this.groupId, contactProjection.groupId) &&
Objects.equals(this.emailAddress, contactProjection.emailAddress) &&
Objects.equals(this.createdAt, contactProjection.createdAt) &&
Objects.equals(this.firstName, contactProjection.firstName) &&
Objects.equals(this.lastName, contactProjection.lastName) &&
Objects.equals(this.company, contactProjection.company) &&
Objects.equals(this.emailAddresses, contactProjection.emailAddresses) &&
Objects.equals(this.optOut, contactProjection.optOut);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, groupId, emailAddress, createdAt, firstName, lastName, company, emailAddresses, optOut);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContactProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" company: ").append(toIndentedString(company)).append("\n");
sb.append(" emailAddresses: ").append(toIndentedString(emailAddresses)).append("\n");
sb.append(" optOut: ").append(toIndentedString(optOut)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("groupId");
openapiFields.add("emailAddress");
openapiFields.add("createdAt");
openapiFields.add("firstName");
openapiFields.add("lastName");
openapiFields.add("company");
openapiFields.add("emailAddresses");
openapiFields.add("optOut");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("optOut");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ContactProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ContactProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ContactProjection is not found in the empty JSON string", ContactProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ContactProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ContactProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ContactProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("groupId") != null && !jsonObj.get("groupId").isJsonNull()) && !jsonObj.get("groupId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `groupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupId").toString()));
}
if ((jsonObj.get("emailAddress") != null && !jsonObj.get("emailAddress").isJsonNull()) && !jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonNull()) && !jsonObj.get("firstName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString()));
}
if ((jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonNull()) && !jsonObj.get("lastName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString()));
}
if ((jsonObj.get("company") != null && !jsonObj.get("company").isJsonNull()) && !jsonObj.get("company").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("emailAddresses") != null && !jsonObj.get("emailAddresses").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("emailAddresses").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ContactProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ContactProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ContactProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ContactProjection.class));
return (TypeAdapter<T>) new TypeAdapter<ContactProjection>() {
@Override
public void write(JsonWriter out, ContactProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ContactProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ContactProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of ContactProjection
* @throws IOException if the JSON string is invalid with respect to ContactProjection
*/
public static ContactProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ContactProjection.class);
}
/**
* Convert an instance of ContactProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Contact object. For saving a user in contact book.
*/
@ApiModel(description = "Contact object. For saving a user in contact book.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ContactDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_GROUP_ID = "groupId";
@SerializedName(SERIALIZED_NAME_GROUP_ID)
private UUID groupId;
public static final String SERIALIZED_NAME_FIRST_NAME = "firstName";
@SerializedName(SERIALIZED_NAME_FIRST_NAME)
private String firstName;
public static final String SERIALIZED_NAME_LAST_NAME = "lastName";
@SerializedName(SERIALIZED_NAME_LAST_NAME)
private String lastName;
public static final String SERIALIZED_NAME_COMPANY = "company";
@SerializedName(SERIALIZED_NAME_COMPANY)
private String company;
public static final String SERIALIZED_NAME_EMAIL_ADDRESSES = "emailAddresses";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESSES)
private List<String> emailAddresses = new ArrayList<>();
public static final String SERIALIZED_NAME_PRIMARY_EMAIL_ADDRESS = "primaryEmailAddress";
@SerializedName(SERIALIZED_NAME_PRIMARY_EMAIL_ADDRESS)
private String primaryEmailAddress;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = new ArrayList<>();
public static final String SERIALIZED_NAME_META_DATA = "metaData";
@SerializedName(SERIALIZED_NAME_META_DATA)
private Object metaData;
public static final String SERIALIZED_NAME_OPT_OUT = "optOut";
@SerializedName(SERIALIZED_NAME_OPT_OUT)
private Boolean optOut;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public ContactDto() {
}
public ContactDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ContactDto groupId(UUID groupId) {
this.groupId = groupId;
return this;
}
/**
* Get groupId
* @return groupId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getGroupId() {
return groupId;
}
public void setGroupId(UUID groupId) {
this.groupId = groupId;
}
public ContactDto firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
* @return firstName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public ContactDto lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
* @return lastName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public ContactDto company(String company) {
this.company = company;
return this;
}
/**
* Get company
* @return company
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public ContactDto emailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
return this;
}
public ContactDto addEmailAddressesItem(String emailAddressesItem) {
this.emailAddresses.add(emailAddressesItem);
return this;
}
/**
* Get emailAddresses
* @return emailAddresses
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getEmailAddresses() {
return emailAddresses;
}
public void setEmailAddresses(List<String> emailAddresses) {
this.emailAddresses = emailAddresses;
}
public ContactDto primaryEmailAddress(String primaryEmailAddress) {
this.primaryEmailAddress = primaryEmailAddress;
return this;
}
/**
* Get primaryEmailAddress
* @return primaryEmailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getPrimaryEmailAddress() {
return primaryEmailAddress;
}
public void setPrimaryEmailAddress(String primaryEmailAddress) {
this.primaryEmailAddress = primaryEmailAddress;
}
public ContactDto tags(List<String> tags) {
this.tags = tags;
return this;
}
public ContactDto addTagsItem(String tagsItem) {
this.tags.add(tagsItem);
return this;
}
/**
* Get tags
* @return tags
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public ContactDto metaData(Object metaData) {
this.metaData = metaData;
return this;
}
/**
* Get metaData
* @return metaData
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Object getMetaData() {
return metaData;
}
public void setMetaData(Object metaData) {
this.metaData = metaData;
}
public ContactDto optOut(Boolean optOut) {
this.optOut = optOut;
return this;
}
/**
* Get optOut
* @return optOut
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getOptOut() {
return optOut;
}
public void setOptOut(Boolean optOut) {
this.optOut = optOut;
}
public ContactDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContactDto contactDto = (ContactDto) o;
return Objects.equals(this.id, contactDto.id) &&
Objects.equals(this.groupId, contactDto.groupId) &&
Objects.equals(this.firstName, contactDto.firstName) &&
Objects.equals(this.lastName, contactDto.lastName) &&
Objects.equals(this.company, contactDto.company) &&
Objects.equals(this.emailAddresses, contactDto.emailAddresses) &&
Objects.equals(this.primaryEmailAddress, contactDto.primaryEmailAddress) &&
Objects.equals(this.tags, contactDto.tags) &&
Objects.equals(this.metaData, contactDto.metaData) &&
Objects.equals(this.optOut, contactDto.optOut) &&
Objects.equals(this.createdAt, contactDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, groupId, firstName, lastName, company, emailAddresses, primaryEmailAddress, tags, metaData, optOut, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContactDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" company: ").append(toIndentedString(company)).append("\n");
sb.append(" emailAddresses: ").append(toIndentedString(emailAddresses)).append("\n");
sb.append(" primaryEmailAddress: ").append(toIndentedString(primaryEmailAddress)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" metaData: ").append(toIndentedString(metaData)).append("\n");
sb.append(" optOut: ").append(toIndentedString(optOut)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("groupId");
openapiFields.add("firstName");
openapiFields.add("lastName");
openapiFields.add("company");
openapiFields.add("emailAddresses");
openapiFields.add("primaryEmailAddress");
openapiFields.add("tags");
openapiFields.add("metaData");
openapiFields.add("optOut");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("emailAddresses");
openapiRequiredFields.add("tags");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ContactDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ContactDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ContactDto is not found in the empty JSON string", ContactDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ContactDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ContactDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ContactDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("groupId") != null && !jsonObj.get("groupId").isJsonNull()) && !jsonObj.get("groupId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `groupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupId").toString()));
}
if ((jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonNull()) && !jsonObj.get("firstName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString()));
}
if ((jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonNull()) && !jsonObj.get("lastName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString()));
}
if ((jsonObj.get("company") != null && !jsonObj.get("company").isJsonNull()) && !jsonObj.get("company").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString()));
}
// ensure the required json array is present
if (jsonObj.get("emailAddresses") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("emailAddresses").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("emailAddresses").toString()));
}
if ((jsonObj.get("primaryEmailAddress") != null && !jsonObj.get("primaryEmailAddress").isJsonNull()) && !jsonObj.get("primaryEmailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `primaryEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryEmailAddress").toString()));
}
// ensure the required json array is present
if (jsonObj.get("tags") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("tags").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ContactDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ContactDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ContactDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ContactDto.class));
return (TypeAdapter<T>) new TypeAdapter<ContactDto>() {
@Override
public void write(JsonWriter out, ContactDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ContactDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ContactDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of ContactDto
* @throws IOException if the JSON string is invalid with respect to ContactDto
*/
public static ContactDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ContactDto.class);
}
/**
* Convert an instance of ContactDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncResult
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncResult {
public static final String SERIALIZED_NAME_EMAIL_SYNC_COUNT = "emailSyncCount";
@SerializedName(SERIALIZED_NAME_EMAIL_SYNC_COUNT)
private Long emailSyncCount;
public static final String SERIALIZED_NAME_LOG_LINES = "logLines";
@SerializedName(SERIALIZED_NAME_LOG_LINES)
private List<String> logLines = null;
public ConnectorSyncResult() {
}
public ConnectorSyncResult emailSyncCount(Long emailSyncCount) {
this.emailSyncCount = emailSyncCount;
return this;
}
/**
* Get emailSyncCount
* @return emailSyncCount
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getEmailSyncCount() {
return emailSyncCount;
}
public void setEmailSyncCount(Long emailSyncCount) {
this.emailSyncCount = emailSyncCount;
}
public ConnectorSyncResult logLines(List<String> logLines) {
this.logLines = logLines;
return this;
}
public ConnectorSyncResult addLogLinesItem(String logLinesItem) {
if (this.logLines == null) {
this.logLines = new ArrayList<>();
}
this.logLines.add(logLinesItem);
return this;
}
/**
* Get logLines
* @return logLines
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getLogLines() {
return logLines;
}
public void setLogLines(List<String> logLines) {
this.logLines = logLines;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncResult connectorSyncResult = (ConnectorSyncResult) o;
return Objects.equals(this.emailSyncCount, connectorSyncResult.emailSyncCount) &&
Objects.equals(this.logLines, connectorSyncResult.logLines);
}
@Override
public int hashCode() {
return Objects.hash(emailSyncCount, logLines);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncResult {\n");
sb.append(" emailSyncCount: ").append(toIndentedString(emailSyncCount)).append("\n");
sb.append(" logLines: ").append(toIndentedString(logLines)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("emailSyncCount");
openapiFields.add("logLines");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("emailSyncCount");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncResult is not found in the empty JSON string", ConnectorSyncResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConnectorSyncResult.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the optional json data is an array if present
if (jsonObj.get("logLines") != null && !jsonObj.get("logLines").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `logLines` to be an array in the JSON string but got `%s`", jsonObj.get("logLines").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncResult.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncResult>() {
@Override
public void write(JsonWriter out, ConnectorSyncResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncResult
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncResult
*/
public static ConnectorSyncResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncResult.class);
}
/**
* Convert an instance of ConnectorSyncResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConnectorSyncRequestResultExceptionCauseStackTraceInner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncRequestResultExceptionCauseSuppressedInner
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncRequestResultExceptionCauseSuppressedInner {
public static final String SERIALIZED_NAME_STACK_TRACE = "stackTrace";
@SerializedName(SERIALIZED_NAME_STACK_TRACE)
private List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace = null;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_LOCALIZED_MESSAGE = "localizedMessage";
@SerializedName(SERIALIZED_NAME_LOCALIZED_MESSAGE)
private String localizedMessage;
public ConnectorSyncRequestResultExceptionCauseSuppressedInner() {
}
public ConnectorSyncRequestResultExceptionCauseSuppressedInner stackTrace(List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace) {
this.stackTrace = stackTrace;
return this;
}
public ConnectorSyncRequestResultExceptionCauseSuppressedInner addStackTraceItem(ConnectorSyncRequestResultExceptionCauseStackTraceInner stackTraceItem) {
if (this.stackTrace == null) {
this.stackTrace = new ArrayList<>();
}
this.stackTrace.add(stackTraceItem);
return this;
}
/**
* Get stackTrace
* @return stackTrace
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> getStackTrace() {
return stackTrace;
}
public void setStackTrace(List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace) {
this.stackTrace = stackTrace;
}
public ConnectorSyncRequestResultExceptionCauseSuppressedInner message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ConnectorSyncRequestResultExceptionCauseSuppressedInner localizedMessage(String localizedMessage) {
this.localizedMessage = localizedMessage;
return this;
}
/**
* Get localizedMessage
* @return localizedMessage
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getLocalizedMessage() {
return localizedMessage;
}
public void setLocalizedMessage(String localizedMessage) {
this.localizedMessage = localizedMessage;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncRequestResultExceptionCauseSuppressedInner connectorSyncRequestResultExceptionCauseSuppressedInner = (ConnectorSyncRequestResultExceptionCauseSuppressedInner) o;
return Objects.equals(this.stackTrace, connectorSyncRequestResultExceptionCauseSuppressedInner.stackTrace) &&
Objects.equals(this.message, connectorSyncRequestResultExceptionCauseSuppressedInner.message) &&
Objects.equals(this.localizedMessage, connectorSyncRequestResultExceptionCauseSuppressedInner.localizedMessage);
}
@Override
public int hashCode() {
return Objects.hash(stackTrace, message, localizedMessage);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncRequestResultExceptionCauseSuppressedInner {\n");
sb.append(" stackTrace: ").append(toIndentedString(stackTrace)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" localizedMessage: ").append(toIndentedString(localizedMessage)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("stackTrace");
openapiFields.add("message");
openapiFields.add("localizedMessage");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncRequestResultExceptionCauseSuppressedInner
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncRequestResultExceptionCauseSuppressedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncRequestResultExceptionCauseSuppressedInner is not found in the empty JSON string", ConnectorSyncRequestResultExceptionCauseSuppressedInner.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncRequestResultExceptionCauseSuppressedInner.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncRequestResultExceptionCauseSuppressedInner` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("stackTrace") != null && !jsonObj.get("stackTrace").isJsonNull()) {
JsonArray jsonArraystackTrace = jsonObj.getAsJsonArray("stackTrace");
if (jsonArraystackTrace != null) {
// ensure the json data is an array
if (!jsonObj.get("stackTrace").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `stackTrace` to be an array in the JSON string but got `%s`", jsonObj.get("stackTrace").toString()));
}
// validate the optional field `stackTrace` (array)
for (int i = 0; i < jsonArraystackTrace.size(); i++) {
ConnectorSyncRequestResultExceptionCauseStackTraceInner.validateJsonObject(jsonArraystackTrace.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
if ((jsonObj.get("localizedMessage") != null && !jsonObj.get("localizedMessage").isJsonNull()) && !jsonObj.get("localizedMessage").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `localizedMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("localizedMessage").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncRequestResultExceptionCauseSuppressedInner.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncRequestResultExceptionCauseSuppressedInner' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncRequestResultExceptionCauseSuppressedInner> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncRequestResultExceptionCauseSuppressedInner.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncRequestResultExceptionCauseSuppressedInner>() {
@Override
public void write(JsonWriter out, ConnectorSyncRequestResultExceptionCauseSuppressedInner value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncRequestResultExceptionCauseSuppressedInner read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncRequestResultExceptionCauseSuppressedInner given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncRequestResultExceptionCauseSuppressedInner
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncRequestResultExceptionCauseSuppressedInner
*/
public static ConnectorSyncRequestResultExceptionCauseSuppressedInner fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncRequestResultExceptionCauseSuppressedInner.class);
}
/**
* Convert an instance of ConnectorSyncRequestResultExceptionCauseSuppressedInner to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncRequestResultExceptionCauseStackTraceInner
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncRequestResultExceptionCauseStackTraceInner {
public static final String SERIALIZED_NAME_CLASS_LOADER_NAME = "classLoaderName";
@SerializedName(SERIALIZED_NAME_CLASS_LOADER_NAME)
private String classLoaderName;
public static final String SERIALIZED_NAME_MODULE_NAME = "moduleName";
@SerializedName(SERIALIZED_NAME_MODULE_NAME)
private String moduleName;
public static final String SERIALIZED_NAME_MODULE_VERSION = "moduleVersion";
@SerializedName(SERIALIZED_NAME_MODULE_VERSION)
private String moduleVersion;
public static final String SERIALIZED_NAME_METHOD_NAME = "methodName";
@SerializedName(SERIALIZED_NAME_METHOD_NAME)
private String methodName;
public static final String SERIALIZED_NAME_FILE_NAME = "fileName";
@SerializedName(SERIALIZED_NAME_FILE_NAME)
private String fileName;
public static final String SERIALIZED_NAME_LINE_NUMBER = "lineNumber";
@SerializedName(SERIALIZED_NAME_LINE_NUMBER)
private Integer lineNumber;
public static final String SERIALIZED_NAME_NATIVE_METHOD = "nativeMethod";
@SerializedName(SERIALIZED_NAME_NATIVE_METHOD)
private Boolean nativeMethod;
public static final String SERIALIZED_NAME_CLASS_NAME = "className";
@SerializedName(SERIALIZED_NAME_CLASS_NAME)
private String className;
public ConnectorSyncRequestResultExceptionCauseStackTraceInner() {
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner classLoaderName(String classLoaderName) {
this.classLoaderName = classLoaderName;
return this;
}
/**
* Get classLoaderName
* @return classLoaderName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getClassLoaderName() {
return classLoaderName;
}
public void setClassLoaderName(String classLoaderName) {
this.classLoaderName = classLoaderName;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner moduleName(String moduleName) {
this.moduleName = moduleName;
return this;
}
/**
* Get moduleName
* @return moduleName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner moduleVersion(String moduleVersion) {
this.moduleVersion = moduleVersion;
return this;
}
/**
* Get moduleVersion
* @return moduleVersion
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModuleVersion() {
return moduleVersion;
}
public void setModuleVersion(String moduleVersion) {
this.moduleVersion = moduleVersion;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner methodName(String methodName) {
this.methodName = methodName;
return this;
}
/**
* Get methodName
* @return methodName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner fileName(String fileName) {
this.fileName = fileName;
return this;
}
/**
* Get fileName
* @return fileName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner lineNumber(Integer lineNumber) {
this.lineNumber = lineNumber;
return this;
}
/**
* Get lineNumber
* @return lineNumber
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getLineNumber() {
return lineNumber;
}
public void setLineNumber(Integer lineNumber) {
this.lineNumber = lineNumber;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner nativeMethod(Boolean nativeMethod) {
this.nativeMethod = nativeMethod;
return this;
}
/**
* Get nativeMethod
* @return nativeMethod
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getNativeMethod() {
return nativeMethod;
}
public void setNativeMethod(Boolean nativeMethod) {
this.nativeMethod = nativeMethod;
}
public ConnectorSyncRequestResultExceptionCauseStackTraceInner className(String className) {
this.className = className;
return this;
}
/**
* Get className
* @return className
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncRequestResultExceptionCauseStackTraceInner connectorSyncRequestResultExceptionCauseStackTraceInner = (ConnectorSyncRequestResultExceptionCauseStackTraceInner) o;
return Objects.equals(this.classLoaderName, connectorSyncRequestResultExceptionCauseStackTraceInner.classLoaderName) &&
Objects.equals(this.moduleName, connectorSyncRequestResultExceptionCauseStackTraceInner.moduleName) &&
Objects.equals(this.moduleVersion, connectorSyncRequestResultExceptionCauseStackTraceInner.moduleVersion) &&
Objects.equals(this.methodName, connectorSyncRequestResultExceptionCauseStackTraceInner.methodName) &&
Objects.equals(this.fileName, connectorSyncRequestResultExceptionCauseStackTraceInner.fileName) &&
Objects.equals(this.lineNumber, connectorSyncRequestResultExceptionCauseStackTraceInner.lineNumber) &&
Objects.equals(this.nativeMethod, connectorSyncRequestResultExceptionCauseStackTraceInner.nativeMethod) &&
Objects.equals(this.className, connectorSyncRequestResultExceptionCauseStackTraceInner.className);
}
@Override
public int hashCode() {
return Objects.hash(classLoaderName, moduleName, moduleVersion, methodName, fileName, lineNumber, nativeMethod, className);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncRequestResultExceptionCauseStackTraceInner {\n");
sb.append(" classLoaderName: ").append(toIndentedString(classLoaderName)).append("\n");
sb.append(" moduleName: ").append(toIndentedString(moduleName)).append("\n");
sb.append(" moduleVersion: ").append(toIndentedString(moduleVersion)).append("\n");
sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n");
sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n");
sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n");
sb.append(" nativeMethod: ").append(toIndentedString(nativeMethod)).append("\n");
sb.append(" className: ").append(toIndentedString(className)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("classLoaderName");
openapiFields.add("moduleName");
openapiFields.add("moduleVersion");
openapiFields.add("methodName");
openapiFields.add("fileName");
openapiFields.add("lineNumber");
openapiFields.add("nativeMethod");
openapiFields.add("className");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncRequestResultExceptionCauseStackTraceInner
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncRequestResultExceptionCauseStackTraceInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncRequestResultExceptionCauseStackTraceInner is not found in the empty JSON string", ConnectorSyncRequestResultExceptionCauseStackTraceInner.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncRequestResultExceptionCauseStackTraceInner.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncRequestResultExceptionCauseStackTraceInner` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if ((jsonObj.get("classLoaderName") != null && !jsonObj.get("classLoaderName").isJsonNull()) && !jsonObj.get("classLoaderName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `classLoaderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("classLoaderName").toString()));
}
if ((jsonObj.get("moduleName") != null && !jsonObj.get("moduleName").isJsonNull()) && !jsonObj.get("moduleName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `moduleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("moduleName").toString()));
}
if ((jsonObj.get("moduleVersion") != null && !jsonObj.get("moduleVersion").isJsonNull()) && !jsonObj.get("moduleVersion").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `moduleVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("moduleVersion").toString()));
}
if ((jsonObj.get("methodName") != null && !jsonObj.get("methodName").isJsonNull()) && !jsonObj.get("methodName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString()));
}
if ((jsonObj.get("fileName") != null && !jsonObj.get("fileName").isJsonNull()) && !jsonObj.get("fileName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `fileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileName").toString()));
}
if ((jsonObj.get("className") != null && !jsonObj.get("className").isJsonNull()) && !jsonObj.get("className").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `className` to be a primitive type in the JSON string but got `%s`", jsonObj.get("className").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncRequestResultExceptionCauseStackTraceInner.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncRequestResultExceptionCauseStackTraceInner' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncRequestResultExceptionCauseStackTraceInner> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncRequestResultExceptionCauseStackTraceInner.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncRequestResultExceptionCauseStackTraceInner>() {
@Override
public void write(JsonWriter out, ConnectorSyncRequestResultExceptionCauseStackTraceInner value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncRequestResultExceptionCauseStackTraceInner read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncRequestResultExceptionCauseStackTraceInner given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncRequestResultExceptionCauseStackTraceInner
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncRequestResultExceptionCauseStackTraceInner
*/
public static ConnectorSyncRequestResultExceptionCauseStackTraceInner fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncRequestResultExceptionCauseStackTraceInner.class);
}
/**
* Convert an instance of ConnectorSyncRequestResultExceptionCauseStackTraceInner to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConnectorSyncRequestResultExceptionCauseStackTraceInner;
import com.mailslurp.models.ConnectorSyncRequestResultExceptionCauseSuppressedInner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncRequestResultExceptionCause
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncRequestResultExceptionCause {
public static final String SERIALIZED_NAME_STACK_TRACE = "stackTrace";
@SerializedName(SERIALIZED_NAME_STACK_TRACE)
private List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace = null;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_SUPPRESSED = "suppressed";
@SerializedName(SERIALIZED_NAME_SUPPRESSED)
private List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> suppressed = null;
public static final String SERIALIZED_NAME_LOCALIZED_MESSAGE = "localizedMessage";
@SerializedName(SERIALIZED_NAME_LOCALIZED_MESSAGE)
private String localizedMessage;
public ConnectorSyncRequestResultExceptionCause() {
}
public ConnectorSyncRequestResultExceptionCause stackTrace(List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace) {
this.stackTrace = stackTrace;
return this;
}
public ConnectorSyncRequestResultExceptionCause addStackTraceItem(ConnectorSyncRequestResultExceptionCauseStackTraceInner stackTraceItem) {
if (this.stackTrace == null) {
this.stackTrace = new ArrayList<>();
}
this.stackTrace.add(stackTraceItem);
return this;
}
/**
* Get stackTrace
* @return stackTrace
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> getStackTrace() {
return stackTrace;
}
public void setStackTrace(List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace) {
this.stackTrace = stackTrace;
}
public ConnectorSyncRequestResultExceptionCause message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ConnectorSyncRequestResultExceptionCause suppressed(List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> suppressed) {
this.suppressed = suppressed;
return this;
}
public ConnectorSyncRequestResultExceptionCause addSuppressedItem(ConnectorSyncRequestResultExceptionCauseSuppressedInner suppressedItem) {
if (this.suppressed == null) {
this.suppressed = new ArrayList<>();
}
this.suppressed.add(suppressedItem);
return this;
}
/**
* Get suppressed
* @return suppressed
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> getSuppressed() {
return suppressed;
}
public void setSuppressed(List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> suppressed) {
this.suppressed = suppressed;
}
public ConnectorSyncRequestResultExceptionCause localizedMessage(String localizedMessage) {
this.localizedMessage = localizedMessage;
return this;
}
/**
* Get localizedMessage
* @return localizedMessage
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getLocalizedMessage() {
return localizedMessage;
}
public void setLocalizedMessage(String localizedMessage) {
this.localizedMessage = localizedMessage;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncRequestResultExceptionCause connectorSyncRequestResultExceptionCause = (ConnectorSyncRequestResultExceptionCause) o;
return Objects.equals(this.stackTrace, connectorSyncRequestResultExceptionCause.stackTrace) &&
Objects.equals(this.message, connectorSyncRequestResultExceptionCause.message) &&
Objects.equals(this.suppressed, connectorSyncRequestResultExceptionCause.suppressed) &&
Objects.equals(this.localizedMessage, connectorSyncRequestResultExceptionCause.localizedMessage);
}
@Override
public int hashCode() {
return Objects.hash(stackTrace, message, suppressed, localizedMessage);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncRequestResultExceptionCause {\n");
sb.append(" stackTrace: ").append(toIndentedString(stackTrace)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" suppressed: ").append(toIndentedString(suppressed)).append("\n");
sb.append(" localizedMessage: ").append(toIndentedString(localizedMessage)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("stackTrace");
openapiFields.add("message");
openapiFields.add("suppressed");
openapiFields.add("localizedMessage");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncRequestResultExceptionCause
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncRequestResultExceptionCause.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncRequestResultExceptionCause is not found in the empty JSON string", ConnectorSyncRequestResultExceptionCause.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncRequestResultExceptionCause.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncRequestResultExceptionCause` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
if (jsonObj.get("stackTrace") != null && !jsonObj.get("stackTrace").isJsonNull()) {
JsonArray jsonArraystackTrace = jsonObj.getAsJsonArray("stackTrace");
if (jsonArraystackTrace != null) {
// ensure the json data is an array
if (!jsonObj.get("stackTrace").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `stackTrace` to be an array in the JSON string but got `%s`", jsonObj.get("stackTrace").toString()));
}
// validate the optional field `stackTrace` (array)
for (int i = 0; i < jsonArraystackTrace.size(); i++) {
ConnectorSyncRequestResultExceptionCauseStackTraceInner.validateJsonObject(jsonArraystackTrace.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
if (jsonObj.get("suppressed") != null && !jsonObj.get("suppressed").isJsonNull()) {
JsonArray jsonArraysuppressed = jsonObj.getAsJsonArray("suppressed");
if (jsonArraysuppressed != null) {
// ensure the json data is an array
if (!jsonObj.get("suppressed").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `suppressed` to be an array in the JSON string but got `%s`", jsonObj.get("suppressed").toString()));
}
// validate the optional field `suppressed` (array)
for (int i = 0; i < jsonArraysuppressed.size(); i++) {
ConnectorSyncRequestResultExceptionCauseSuppressedInner.validateJsonObject(jsonArraysuppressed.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("localizedMessage") != null && !jsonObj.get("localizedMessage").isJsonNull()) && !jsonObj.get("localizedMessage").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `localizedMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("localizedMessage").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncRequestResultExceptionCause.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncRequestResultExceptionCause' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncRequestResultExceptionCause> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncRequestResultExceptionCause.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncRequestResultExceptionCause>() {
@Override
public void write(JsonWriter out, ConnectorSyncRequestResultExceptionCause value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncRequestResultExceptionCause read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncRequestResultExceptionCause given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncRequestResultExceptionCause
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncRequestResultExceptionCause
*/
public static ConnectorSyncRequestResultExceptionCause fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncRequestResultExceptionCause.class);
}
/**
* Convert an instance of ConnectorSyncRequestResultExceptionCause to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConnectorSyncRequestResultExceptionCause;
import com.mailslurp.models.ConnectorSyncRequestResultExceptionCauseStackTraceInner;
import com.mailslurp.models.ConnectorSyncRequestResultExceptionCauseSuppressedInner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncRequestResultException
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncRequestResultException {
public static final String SERIALIZED_NAME_CAUSE = "cause";
@SerializedName(SERIALIZED_NAME_CAUSE)
private ConnectorSyncRequestResultExceptionCause cause;
public static final String SERIALIZED_NAME_STACK_TRACE = "stackTrace";
@SerializedName(SERIALIZED_NAME_STACK_TRACE)
private List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace = null;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_SUPPRESSED = "suppressed";
@SerializedName(SERIALIZED_NAME_SUPPRESSED)
private List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> suppressed = null;
public static final String SERIALIZED_NAME_LOCALIZED_MESSAGE = "localizedMessage";
@SerializedName(SERIALIZED_NAME_LOCALIZED_MESSAGE)
private String localizedMessage;
public ConnectorSyncRequestResultException() {
}
public ConnectorSyncRequestResultException cause(ConnectorSyncRequestResultExceptionCause cause) {
this.cause = cause;
return this;
}
/**
* Get cause
* @return cause
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public ConnectorSyncRequestResultExceptionCause getCause() {
return cause;
}
public void setCause(ConnectorSyncRequestResultExceptionCause cause) {
this.cause = cause;
}
public ConnectorSyncRequestResultException stackTrace(List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace) {
this.stackTrace = stackTrace;
return this;
}
public ConnectorSyncRequestResultException addStackTraceItem(ConnectorSyncRequestResultExceptionCauseStackTraceInner stackTraceItem) {
if (this.stackTrace == null) {
this.stackTrace = new ArrayList<>();
}
this.stackTrace.add(stackTraceItem);
return this;
}
/**
* Get stackTrace
* @return stackTrace
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> getStackTrace() {
return stackTrace;
}
public void setStackTrace(List<ConnectorSyncRequestResultExceptionCauseStackTraceInner> stackTrace) {
this.stackTrace = stackTrace;
}
public ConnectorSyncRequestResultException message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ConnectorSyncRequestResultException suppressed(List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> suppressed) {
this.suppressed = suppressed;
return this;
}
public ConnectorSyncRequestResultException addSuppressedItem(ConnectorSyncRequestResultExceptionCauseSuppressedInner suppressedItem) {
if (this.suppressed == null) {
this.suppressed = new ArrayList<>();
}
this.suppressed.add(suppressedItem);
return this;
}
/**
* Get suppressed
* @return suppressed
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> getSuppressed() {
return suppressed;
}
public void setSuppressed(List<ConnectorSyncRequestResultExceptionCauseSuppressedInner> suppressed) {
this.suppressed = suppressed;
}
public ConnectorSyncRequestResultException localizedMessage(String localizedMessage) {
this.localizedMessage = localizedMessage;
return this;
}
/**
* Get localizedMessage
* @return localizedMessage
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getLocalizedMessage() {
return localizedMessage;
}
public void setLocalizedMessage(String localizedMessage) {
this.localizedMessage = localizedMessage;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncRequestResultException connectorSyncRequestResultException = (ConnectorSyncRequestResultException) o;
return Objects.equals(this.cause, connectorSyncRequestResultException.cause) &&
Objects.equals(this.stackTrace, connectorSyncRequestResultException.stackTrace) &&
Objects.equals(this.message, connectorSyncRequestResultException.message) &&
Objects.equals(this.suppressed, connectorSyncRequestResultException.suppressed) &&
Objects.equals(this.localizedMessage, connectorSyncRequestResultException.localizedMessage);
}
@Override
public int hashCode() {
return Objects.hash(cause, stackTrace, message, suppressed, localizedMessage);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncRequestResultException {\n");
sb.append(" cause: ").append(toIndentedString(cause)).append("\n");
sb.append(" stackTrace: ").append(toIndentedString(stackTrace)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" suppressed: ").append(toIndentedString(suppressed)).append("\n");
sb.append(" localizedMessage: ").append(toIndentedString(localizedMessage)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("cause");
openapiFields.add("stackTrace");
openapiFields.add("message");
openapiFields.add("suppressed");
openapiFields.add("localizedMessage");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncRequestResultException
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncRequestResultException.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncRequestResultException is not found in the empty JSON string", ConnectorSyncRequestResultException.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncRequestResultException.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncRequestResultException` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// validate the optional field `cause`
if (jsonObj.get("cause") != null && !jsonObj.get("cause").isJsonNull()) {
ConnectorSyncRequestResultExceptionCause.validateJsonObject(jsonObj.getAsJsonObject("cause"));
}
if (jsonObj.get("stackTrace") != null && !jsonObj.get("stackTrace").isJsonNull()) {
JsonArray jsonArraystackTrace = jsonObj.getAsJsonArray("stackTrace");
if (jsonArraystackTrace != null) {
// ensure the json data is an array
if (!jsonObj.get("stackTrace").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `stackTrace` to be an array in the JSON string but got `%s`", jsonObj.get("stackTrace").toString()));
}
// validate the optional field `stackTrace` (array)
for (int i = 0; i < jsonArraystackTrace.size(); i++) {
ConnectorSyncRequestResultExceptionCauseStackTraceInner.validateJsonObject(jsonArraystackTrace.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
if (jsonObj.get("suppressed") != null && !jsonObj.get("suppressed").isJsonNull()) {
JsonArray jsonArraysuppressed = jsonObj.getAsJsonArray("suppressed");
if (jsonArraysuppressed != null) {
// ensure the json data is an array
if (!jsonObj.get("suppressed").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `suppressed` to be an array in the JSON string but got `%s`", jsonObj.get("suppressed").toString()));
}
// validate the optional field `suppressed` (array)
for (int i = 0; i < jsonArraysuppressed.size(); i++) {
ConnectorSyncRequestResultExceptionCauseSuppressedInner.validateJsonObject(jsonArraysuppressed.get(i).getAsJsonObject());
};
}
}
if ((jsonObj.get("localizedMessage") != null && !jsonObj.get("localizedMessage").isJsonNull()) && !jsonObj.get("localizedMessage").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `localizedMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("localizedMessage").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncRequestResultException.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncRequestResultException' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncRequestResultException> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncRequestResultException.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncRequestResultException>() {
@Override
public void write(JsonWriter out, ConnectorSyncRequestResultException value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncRequestResultException read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncRequestResultException given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncRequestResultException
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncRequestResultException
*/
public static ConnectorSyncRequestResultException fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncRequestResultException.class);
}
/**
* Convert an instance of ConnectorSyncRequestResultException to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.ConnectorSyncRequestResultException;
import com.mailslurp.models.ConnectorSyncResult;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncRequestResult
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncRequestResult {
public static final String SERIALIZED_NAME_SYNC_RESULT = "syncResult";
@SerializedName(SERIALIZED_NAME_SYNC_RESULT)
private ConnectorSyncResult syncResult;
public static final String SERIALIZED_NAME_EXCEPTION = "exception";
@SerializedName(SERIALIZED_NAME_EXCEPTION)
private ConnectorSyncRequestResultException exception;
public static final String SERIALIZED_NAME_EVENT_ID = "eventId";
@SerializedName(SERIALIZED_NAME_EVENT_ID)
private UUID eventId;
public ConnectorSyncRequestResult() {
}
public ConnectorSyncRequestResult syncResult(ConnectorSyncResult syncResult) {
this.syncResult = syncResult;
return this;
}
/**
* Get syncResult
* @return syncResult
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public ConnectorSyncResult getSyncResult() {
return syncResult;
}
public void setSyncResult(ConnectorSyncResult syncResult) {
this.syncResult = syncResult;
}
public ConnectorSyncRequestResult exception(ConnectorSyncRequestResultException exception) {
this.exception = exception;
return this;
}
/**
* Get exception
* @return exception
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public ConnectorSyncRequestResultException getException() {
return exception;
}
public void setException(ConnectorSyncRequestResultException exception) {
this.exception = exception;
}
public ConnectorSyncRequestResult eventId(UUID eventId) {
this.eventId = eventId;
return this;
}
/**
* Get eventId
* @return eventId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getEventId() {
return eventId;
}
public void setEventId(UUID eventId) {
this.eventId = eventId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncRequestResult connectorSyncRequestResult = (ConnectorSyncRequestResult) o;
return Objects.equals(this.syncResult, connectorSyncRequestResult.syncResult) &&
Objects.equals(this.exception, connectorSyncRequestResult.exception) &&
Objects.equals(this.eventId, connectorSyncRequestResult.eventId);
}
@Override
public int hashCode() {
return Objects.hash(syncResult, exception, eventId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncRequestResult {\n");
sb.append(" syncResult: ").append(toIndentedString(syncResult)).append("\n");
sb.append(" exception: ").append(toIndentedString(exception)).append("\n");
sb.append(" eventId: ").append(toIndentedString(eventId)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("syncResult");
openapiFields.add("exception");
openapiFields.add("eventId");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncRequestResult
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncRequestResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncRequestResult is not found in the empty JSON string", ConnectorSyncRequestResult.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncRequestResult.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncRequestResult` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// validate the optional field `syncResult`
if (jsonObj.get("syncResult") != null && !jsonObj.get("syncResult").isJsonNull()) {
ConnectorSyncResult.validateJsonObject(jsonObj.getAsJsonObject("syncResult"));
}
// validate the optional field `exception`
if (jsonObj.get("exception") != null && !jsonObj.get("exception").isJsonNull()) {
ConnectorSyncRequestResultException.validateJsonObject(jsonObj.getAsJsonObject("exception"));
}
if ((jsonObj.get("eventId") != null && !jsonObj.get("eventId").isJsonNull()) && !jsonObj.get("eventId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventId").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncRequestResult.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncRequestResult' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncRequestResult> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncRequestResult.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncRequestResult>() {
@Override
public void write(JsonWriter out, ConnectorSyncRequestResult value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncRequestResult read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncRequestResult given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncRequestResult
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncRequestResult
*/
public static ConnectorSyncRequestResult fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncRequestResult.class);
}
/**
* Convert an instance of ConnectorSyncRequestResult to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncEventProjection
*/
@ApiModel(description = "ConnectorSyncEventProjection")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncEventProjection {
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId";
@SerializedName(SERIALIZED_NAME_CONNECTOR_ID)
private UUID connectorId;
public static final String SERIALIZED_NAME_SYNC_COUNT = "syncCount";
@SerializedName(SERIALIZED_NAME_SYNC_COUNT)
private Long syncCount;
/**
* Gets or Sets syncStatus
*/
@JsonAdapter(SyncStatusEnum.Adapter.class)
public enum SyncStatusEnum {
SUCCESS("SUCCESS"),
INTERNAL_ERROR("INTERNAL_ERROR"),
SUBSCRIPTION_ERROR("SUBSCRIPTION_ERROR"),
CONNECTION_ERROR("CONNECTION_ERROR"),
NOT_FOUND("NOT_FOUND");
private String value;
SyncStatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SyncStatusEnum fromValue(String value) {
for (SyncStatusEnum b : SyncStatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SyncStatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SyncStatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SyncStatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SyncStatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SYNC_STATUS = "syncStatus";
@SerializedName(SERIALIZED_NAME_SYNC_STATUS)
private SyncStatusEnum syncStatus;
public ConnectorSyncEventProjection() {
}
public ConnectorSyncEventProjection message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ConnectorSyncEventProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ConnectorSyncEventProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ConnectorSyncEventProjection connectorId(UUID connectorId) {
this.connectorId = connectorId;
return this;
}
/**
* Get connectorId
* @return connectorId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getConnectorId() {
return connectorId;
}
public void setConnectorId(UUID connectorId) {
this.connectorId = connectorId;
}
public ConnectorSyncEventProjection syncCount(Long syncCount) {
this.syncCount = syncCount;
return this;
}
/**
* Get syncCount
* @return syncCount
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getSyncCount() {
return syncCount;
}
public void setSyncCount(Long syncCount) {
this.syncCount = syncCount;
}
public ConnectorSyncEventProjection syncStatus(SyncStatusEnum syncStatus) {
this.syncStatus = syncStatus;
return this;
}
/**
* Get syncStatus
* @return syncStatus
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public SyncStatusEnum getSyncStatus() {
return syncStatus;
}
public void setSyncStatus(SyncStatusEnum syncStatus) {
this.syncStatus = syncStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncEventProjection connectorSyncEventProjection = (ConnectorSyncEventProjection) o;
return Objects.equals(this.message, connectorSyncEventProjection.message) &&
Objects.equals(this.id, connectorSyncEventProjection.id) &&
Objects.equals(this.createdAt, connectorSyncEventProjection.createdAt) &&
Objects.equals(this.connectorId, connectorSyncEventProjection.connectorId) &&
Objects.equals(this.syncCount, connectorSyncEventProjection.syncCount) &&
Objects.equals(this.syncStatus, connectorSyncEventProjection.syncStatus);
}
@Override
public int hashCode() {
return Objects.hash(message, id, createdAt, connectorId, syncCount, syncStatus);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncEventProjection {\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n");
sb.append(" syncCount: ").append(toIndentedString(syncCount)).append("\n");
sb.append(" syncStatus: ").append(toIndentedString(syncStatus)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("message");
openapiFields.add("id");
openapiFields.add("createdAt");
openapiFields.add("connectorId");
openapiFields.add("syncCount");
openapiFields.add("syncStatus");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("connectorId");
openapiRequiredFields.add("syncCount");
openapiRequiredFields.add("syncStatus");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncEventProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncEventProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncEventProjection is not found in the empty JSON string", ConnectorSyncEventProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncEventProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncEventProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConnectorSyncEventProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("connectorId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString()));
}
if (!jsonObj.get("syncStatus").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `syncStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("syncStatus").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncEventProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncEventProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncEventProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncEventProjection.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncEventProjection>() {
@Override
public void write(JsonWriter out, ConnectorSyncEventProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncEventProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncEventProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncEventProjection
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncEventProjection
*/
public static ConnectorSyncEventProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncEventProjection.class);
}
/**
* Convert an instance of ConnectorSyncEventProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorSyncEventDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorSyncEventDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId";
@SerializedName(SERIALIZED_NAME_CONNECTOR_ID)
private UUID connectorId;
/**
* Gets or Sets syncStatus
*/
@JsonAdapter(SyncStatusEnum.Adapter.class)
public enum SyncStatusEnum {
SUCCESS("SUCCESS"),
INTERNAL_ERROR("INTERNAL_ERROR"),
SUBSCRIPTION_ERROR("SUBSCRIPTION_ERROR"),
CONNECTION_ERROR("CONNECTION_ERROR"),
NOT_FOUND("NOT_FOUND");
private String value;
SyncStatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SyncStatusEnum fromValue(String value) {
for (SyncStatusEnum b : SyncStatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SyncStatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SyncStatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SyncStatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SyncStatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SYNC_STATUS = "syncStatus";
@SerializedName(SERIALIZED_NAME_SYNC_STATUS)
private SyncStatusEnum syncStatus;
public static final String SERIALIZED_NAME_SYNC_COUNT = "syncCount";
@SerializedName(SERIALIZED_NAME_SYNC_COUNT)
private Long syncCount;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public ConnectorSyncEventDto() {
}
public ConnectorSyncEventDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ConnectorSyncEventDto connectorId(UUID connectorId) {
this.connectorId = connectorId;
return this;
}
/**
* Get connectorId
* @return connectorId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getConnectorId() {
return connectorId;
}
public void setConnectorId(UUID connectorId) {
this.connectorId = connectorId;
}
public ConnectorSyncEventDto syncStatus(SyncStatusEnum syncStatus) {
this.syncStatus = syncStatus;
return this;
}
/**
* Get syncStatus
* @return syncStatus
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public SyncStatusEnum getSyncStatus() {
return syncStatus;
}
public void setSyncStatus(SyncStatusEnum syncStatus) {
this.syncStatus = syncStatus;
}
public ConnectorSyncEventDto syncCount(Long syncCount) {
this.syncCount = syncCount;
return this;
}
/**
* Get syncCount
* @return syncCount
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Long getSyncCount() {
return syncCount;
}
public void setSyncCount(Long syncCount) {
this.syncCount = syncCount;
}
public ConnectorSyncEventDto message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ConnectorSyncEventDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorSyncEventDto connectorSyncEventDto = (ConnectorSyncEventDto) o;
return Objects.equals(this.id, connectorSyncEventDto.id) &&
Objects.equals(this.connectorId, connectorSyncEventDto.connectorId) &&
Objects.equals(this.syncStatus, connectorSyncEventDto.syncStatus) &&
Objects.equals(this.syncCount, connectorSyncEventDto.syncCount) &&
Objects.equals(this.message, connectorSyncEventDto.message) &&
Objects.equals(this.createdAt, connectorSyncEventDto.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, connectorId, syncStatus, syncCount, message, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorSyncEventDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n");
sb.append(" syncStatus: ").append(toIndentedString(syncStatus)).append("\n");
sb.append(" syncCount: ").append(toIndentedString(syncCount)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("connectorId");
openapiFields.add("syncStatus");
openapiFields.add("syncCount");
openapiFields.add("message");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("connectorId");
openapiRequiredFields.add("syncStatus");
openapiRequiredFields.add("syncCount");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorSyncEventDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorSyncEventDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorSyncEventDto is not found in the empty JSON string", ConnectorSyncEventDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorSyncEventDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorSyncEventDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConnectorSyncEventDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("connectorId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString()));
}
if (!jsonObj.get("syncStatus").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `syncStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("syncStatus").toString()));
}
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorSyncEventDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorSyncEventDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorSyncEventDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorSyncEventDto.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorSyncEventDto>() {
@Override
public void write(JsonWriter out, ConnectorSyncEventDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorSyncEventDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorSyncEventDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorSyncEventDto
* @throws IOException if the JSON string is invalid with respect to ConnectorSyncEventDto
*/
public static ConnectorSyncEventDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorSyncEventDto.class);
}
/**
* Convert an instance of ConnectorSyncEventDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Connector
*/
@ApiModel(description = "Connector")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
/**
* Gets or Sets connectorType
*/
@JsonAdapter(ConnectorTypeEnum.Adapter.class)
public enum ConnectorTypeEnum {
IMAP("IMAP");
private String value;
ConnectorTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ConnectorTypeEnum fromValue(String value) {
for (ConnectorTypeEnum b : ConnectorTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ConnectorTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ConnectorTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ConnectorTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ConnectorTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_CONNECTOR_TYPE = "connectorType";
@SerializedName(SERIALIZED_NAME_CONNECTOR_TYPE)
private ConnectorTypeEnum connectorType;
/**
* Gets or Sets syncScheduleType
*/
@JsonAdapter(SyncScheduleTypeEnum.Adapter.class)
public enum SyncScheduleTypeEnum {
INTERVAL("INTERVAL");
private String value;
SyncScheduleTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SyncScheduleTypeEnum fromValue(String value) {
for (SyncScheduleTypeEnum b : SyncScheduleTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SyncScheduleTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SyncScheduleTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SyncScheduleTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SyncScheduleTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SYNC_SCHEDULE_TYPE = "syncScheduleType";
@SerializedName(SERIALIZED_NAME_SYNC_SCHEDULE_TYPE)
private SyncScheduleTypeEnum syncScheduleType;
public static final String SERIALIZED_NAME_SYNC_INTERVAL = "syncInterval";
@SerializedName(SERIALIZED_NAME_SYNC_INTERVAL)
private Integer syncInterval;
public static final String SERIALIZED_NAME_SYNC_ENABLED = "syncEnabled";
@SerializedName(SERIALIZED_NAME_SYNC_ENABLED)
private Boolean syncEnabled;
public ConnectorProjection() {
}
public ConnectorProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ConnectorProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public ConnectorProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public ConnectorProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public ConnectorProjection connectorType(ConnectorTypeEnum connectorType) {
this.connectorType = connectorType;
return this;
}
/**
* Get connectorType
* @return connectorType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ConnectorTypeEnum getConnectorType() {
return connectorType;
}
public void setConnectorType(ConnectorTypeEnum connectorType) {
this.connectorType = connectorType;
}
public ConnectorProjection syncScheduleType(SyncScheduleTypeEnum syncScheduleType) {
this.syncScheduleType = syncScheduleType;
return this;
}
/**
* Get syncScheduleType
* @return syncScheduleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public SyncScheduleTypeEnum getSyncScheduleType() {
return syncScheduleType;
}
public void setSyncScheduleType(SyncScheduleTypeEnum syncScheduleType) {
this.syncScheduleType = syncScheduleType;
}
public ConnectorProjection syncInterval(Integer syncInterval) {
this.syncInterval = syncInterval;
return this;
}
/**
* Get syncInterval
* @return syncInterval
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSyncInterval() {
return syncInterval;
}
public void setSyncInterval(Integer syncInterval) {
this.syncInterval = syncInterval;
}
public ConnectorProjection syncEnabled(Boolean syncEnabled) {
this.syncEnabled = syncEnabled;
return this;
}
/**
* Get syncEnabled
* @return syncEnabled
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSyncEnabled() {
return syncEnabled;
}
public void setSyncEnabled(Boolean syncEnabled) {
this.syncEnabled = syncEnabled;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorProjection connectorProjection = (ConnectorProjection) o;
return Objects.equals(this.id, connectorProjection.id) &&
Objects.equals(this.inboxId, connectorProjection.inboxId) &&
Objects.equals(this.userId, connectorProjection.userId) &&
Objects.equals(this.createdAt, connectorProjection.createdAt) &&
Objects.equals(this.connectorType, connectorProjection.connectorType) &&
Objects.equals(this.syncScheduleType, connectorProjection.syncScheduleType) &&
Objects.equals(this.syncInterval, connectorProjection.syncInterval) &&
Objects.equals(this.syncEnabled, connectorProjection.syncEnabled);
}
@Override
public int hashCode() {
return Objects.hash(id, inboxId, userId, createdAt, connectorType, syncScheduleType, syncInterval, syncEnabled);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" connectorType: ").append(toIndentedString(connectorType)).append("\n");
sb.append(" syncScheduleType: ").append(toIndentedString(syncScheduleType)).append("\n");
sb.append(" syncInterval: ").append(toIndentedString(syncInterval)).append("\n");
sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("connectorType");
openapiFields.add("syncScheduleType");
openapiFields.add("syncInterval");
openapiFields.add("syncEnabled");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("connectorType");
openapiRequiredFields.add("syncScheduleType");
openapiRequiredFields.add("syncEnabled");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorProjection is not found in the empty JSON string", ConnectorProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConnectorProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("connectorType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorType").toString()));
}
if (!jsonObj.get("syncScheduleType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `syncScheduleType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("syncScheduleType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorProjection.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorProjection>() {
@Override
public void write(JsonWriter out, ConnectorProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorProjection
* @throws IOException if the JSON string is invalid with respect to ConnectorProjection
*/
public static ConnectorProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorProjection.class);
}
/**
* Convert an instance of ConnectorProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* ConnectorDto
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConnectorDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
/**
* Gets or Sets connectorType
*/
@JsonAdapter(ConnectorTypeEnum.Adapter.class)
public enum ConnectorTypeEnum {
IMAP("IMAP");
private String value;
ConnectorTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ConnectorTypeEnum fromValue(String value) {
for (ConnectorTypeEnum b : ConnectorTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ConnectorTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ConnectorTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ConnectorTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ConnectorTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_CONNECTOR_TYPE = "connectorType";
@SerializedName(SERIALIZED_NAME_CONNECTOR_TYPE)
private ConnectorTypeEnum connectorType;
/**
* Gets or Sets connectorAuthType
*/
@JsonAdapter(ConnectorAuthTypeEnum.Adapter.class)
public enum ConnectorAuthTypeEnum {
PLAIN_TEXT("PLAIN_TEXT");
private String value;
ConnectorAuthTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ConnectorAuthTypeEnum fromValue(String value) {
for (ConnectorAuthTypeEnum b : ConnectorAuthTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ConnectorAuthTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ConnectorAuthTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ConnectorAuthTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ConnectorAuthTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_CONNECTOR_AUTH_TYPE = "connectorAuthType";
@SerializedName(SERIALIZED_NAME_CONNECTOR_AUTH_TYPE)
private ConnectorAuthTypeEnum connectorAuthType;
public static final String SERIALIZED_NAME_SYNC_ENABLED = "syncEnabled";
@SerializedName(SERIALIZED_NAME_SYNC_ENABLED)
private Boolean syncEnabled;
/**
* Gets or Sets syncScheduleType
*/
@JsonAdapter(SyncScheduleTypeEnum.Adapter.class)
public enum SyncScheduleTypeEnum {
INTERVAL("INTERVAL");
private String value;
SyncScheduleTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SyncScheduleTypeEnum fromValue(String value) {
for (SyncScheduleTypeEnum b : SyncScheduleTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SyncScheduleTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SyncScheduleTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SyncScheduleTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SyncScheduleTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_SYNC_SCHEDULE_TYPE = "syncScheduleType";
@SerializedName(SERIALIZED_NAME_SYNC_SCHEDULE_TYPE)
private SyncScheduleTypeEnum syncScheduleType;
public static final String SERIALIZED_NAME_SYNC_INTERVAL = "syncInterval";
@SerializedName(SERIALIZED_NAME_SYNC_INTERVAL)
private Integer syncInterval;
public static final String SERIALIZED_NAME_IMAP_HOST = "imapHost";
@SerializedName(SERIALIZED_NAME_IMAP_HOST)
private String imapHost;
public static final String SERIALIZED_NAME_IMAP_PORT = "imapPort";
@SerializedName(SERIALIZED_NAME_IMAP_PORT)
private Integer imapPort;
public static final String SERIALIZED_NAME_IMAP_USERNAME = "imapUsername";
@SerializedName(SERIALIZED_NAME_IMAP_USERNAME)
private String imapUsername;
public static final String SERIALIZED_NAME_IMAP_PASSWORD = "imapPassword";
@SerializedName(SERIALIZED_NAME_IMAP_PASSWORD)
private String imapPassword;
public static final String SERIALIZED_NAME_IMAP_SSL = "imapSsl";
@SerializedName(SERIALIZED_NAME_IMAP_SSL)
private Boolean imapSsl;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public ConnectorDto() {
}
public ConnectorDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public ConnectorDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public ConnectorDto connectorType(ConnectorTypeEnum connectorType) {
this.connectorType = connectorType;
return this;
}
/**
* Get connectorType
* @return connectorType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ConnectorTypeEnum getConnectorType() {
return connectorType;
}
public void setConnectorType(ConnectorTypeEnum connectorType) {
this.connectorType = connectorType;
}
public ConnectorDto connectorAuthType(ConnectorAuthTypeEnum connectorAuthType) {
this.connectorAuthType = connectorAuthType;
return this;
}
/**
* Get connectorAuthType
* @return connectorAuthType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public ConnectorAuthTypeEnum getConnectorAuthType() {
return connectorAuthType;
}
public void setConnectorAuthType(ConnectorAuthTypeEnum connectorAuthType) {
this.connectorAuthType = connectorAuthType;
}
public ConnectorDto syncEnabled(Boolean syncEnabled) {
this.syncEnabled = syncEnabled;
return this;
}
/**
* Get syncEnabled
* @return syncEnabled
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public Boolean getSyncEnabled() {
return syncEnabled;
}
public void setSyncEnabled(Boolean syncEnabled) {
this.syncEnabled = syncEnabled;
}
public ConnectorDto syncScheduleType(SyncScheduleTypeEnum syncScheduleType) {
this.syncScheduleType = syncScheduleType;
return this;
}
/**
* Get syncScheduleType
* @return syncScheduleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public SyncScheduleTypeEnum getSyncScheduleType() {
return syncScheduleType;
}
public void setSyncScheduleType(SyncScheduleTypeEnum syncScheduleType) {
this.syncScheduleType = syncScheduleType;
}
public ConnectorDto syncInterval(Integer syncInterval) {
this.syncInterval = syncInterval;
return this;
}
/**
* Get syncInterval
* @return syncInterval
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getSyncInterval() {
return syncInterval;
}
public void setSyncInterval(Integer syncInterval) {
this.syncInterval = syncInterval;
}
public ConnectorDto imapHost(String imapHost) {
this.imapHost = imapHost;
return this;
}
/**
* Get imapHost
* @return imapHost
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getImapHost() {
return imapHost;
}
public void setImapHost(String imapHost) {
this.imapHost = imapHost;
}
public ConnectorDto imapPort(Integer imapPort) {
this.imapPort = imapPort;
return this;
}
/**
* Get imapPort
* @return imapPort
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getImapPort() {
return imapPort;
}
public void setImapPort(Integer imapPort) {
this.imapPort = imapPort;
}
public ConnectorDto imapUsername(String imapUsername) {
this.imapUsername = imapUsername;
return this;
}
/**
* Get imapUsername
* @return imapUsername
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getImapUsername() {
return imapUsername;
}
public void setImapUsername(String imapUsername) {
this.imapUsername = imapUsername;
}
public ConnectorDto imapPassword(String imapPassword) {
this.imapPassword = imapPassword;
return this;
}
/**
* Get imapPassword
* @return imapPassword
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getImapPassword() {
return imapPassword;
}
public void setImapPassword(String imapPassword) {
this.imapPassword = imapPassword;
}
public ConnectorDto imapSsl(Boolean imapSsl) {
this.imapSsl = imapSsl;
return this;
}
/**
* Get imapSsl
* @return imapSsl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getImapSsl() {
return imapSsl;
}
public void setImapSsl(Boolean imapSsl) {
this.imapSsl = imapSsl;
}
public ConnectorDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConnectorDto connectorDto = (ConnectorDto) o;
return Objects.equals(this.id, connectorDto.id) &&
Objects.equals(this.userId, connectorDto.userId) &&
Objects.equals(this.connectorType, connectorDto.connectorType) &&
Objects.equals(this.connectorAuthType, connectorDto.connectorAuthType) &&
Objects.equals(this.syncEnabled, connectorDto.syncEnabled) &&
Objects.equals(this.syncScheduleType, connectorDto.syncScheduleType) &&
Objects.equals(this.syncInterval, connectorDto.syncInterval) &&
Objects.equals(this.imapHost, connectorDto.imapHost) &&
Objects.equals(this.imapPort, connectorDto.imapPort) &&
Objects.equals(this.imapUsername, connectorDto.imapUsername) &&
Objects.equals(this.imapPassword, connectorDto.imapPassword) &&
Objects.equals(this.imapSsl, connectorDto.imapSsl) &&
Objects.equals(this.createdAt, connectorDto.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, connectorType, connectorAuthType, syncEnabled, syncScheduleType, syncInterval, imapHost, imapPort, imapUsername, imapPassword, imapSsl, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectorDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" connectorType: ").append(toIndentedString(connectorType)).append("\n");
sb.append(" connectorAuthType: ").append(toIndentedString(connectorAuthType)).append("\n");
sb.append(" syncEnabled: ").append(toIndentedString(syncEnabled)).append("\n");
sb.append(" syncScheduleType: ").append(toIndentedString(syncScheduleType)).append("\n");
sb.append(" syncInterval: ").append(toIndentedString(syncInterval)).append("\n");
sb.append(" imapHost: ").append(toIndentedString(imapHost)).append("\n");
sb.append(" imapPort: ").append(toIndentedString(imapPort)).append("\n");
sb.append(" imapUsername: ").append(toIndentedString(imapUsername)).append("\n");
sb.append(" imapPassword: ").append(toIndentedString(imapPassword)).append("\n");
sb.append(" imapSsl: ").append(toIndentedString(imapSsl)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("connectorType");
openapiFields.add("connectorAuthType");
openapiFields.add("syncEnabled");
openapiFields.add("syncScheduleType");
openapiFields.add("syncInterval");
openapiFields.add("imapHost");
openapiFields.add("imapPort");
openapiFields.add("imapUsername");
openapiFields.add("imapPassword");
openapiFields.add("imapSsl");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("connectorType");
openapiRequiredFields.add("connectorAuthType");
openapiRequiredFields.add("syncEnabled");
openapiRequiredFields.add("syncScheduleType");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConnectorDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConnectorDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectorDto is not found in the empty JSON string", ConnectorDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConnectorDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectorDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConnectorDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("connectorType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorType").toString()));
}
if (!jsonObj.get("connectorAuthType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `connectorAuthType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorAuthType").toString()));
}
if (!jsonObj.get("syncScheduleType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `syncScheduleType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("syncScheduleType").toString()));
}
if ((jsonObj.get("imapHost") != null && !jsonObj.get("imapHost").isJsonNull()) && !jsonObj.get("imapHost").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `imapHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imapHost").toString()));
}
if ((jsonObj.get("imapUsername") != null && !jsonObj.get("imapUsername").isJsonNull()) && !jsonObj.get("imapUsername").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `imapUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imapUsername").toString()));
}
if ((jsonObj.get("imapPassword") != null && !jsonObj.get("imapPassword").isJsonNull()) && !jsonObj.get("imapPassword").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `imapPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imapPassword").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConnectorDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConnectorDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConnectorDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConnectorDto.class));
return (TypeAdapter<T>) new TypeAdapter<ConnectorDto>() {
@Override
public void write(JsonWriter out, ConnectorDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConnectorDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConnectorDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConnectorDto
* @throws IOException if the JSON string is invalid with respect to ConnectorDto
*/
public static ConnectorDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConnectorDto.class);
}
/**
* Convert an instance of ConnectorDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for matching emails in an inbox based on a condition such as `HAS_ATTACHMENTS=TRUE`
*/
@ApiModel(description = "Options for matching emails in an inbox based on a condition such as `HAS_ATTACHMENTS=TRUE`")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ConditionOption {
/**
* Condition of an email object that can be used to filter results
*/
@JsonAdapter(ConditionEnum.Adapter.class)
public enum ConditionEnum {
HAS_ATTACHMENTS("HAS_ATTACHMENTS");
private String value;
ConditionEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ConditionEnum fromValue(String value) {
for (ConditionEnum b : ConditionEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ConditionEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ConditionEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ConditionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ConditionEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_CONDITION = "condition";
@SerializedName(SERIALIZED_NAME_CONDITION)
private ConditionEnum condition;
/**
* Expected condition value
*/
@JsonAdapter(ValueEnum.Adapter.class)
public enum ValueEnum {
TRUE("TRUE"),
FALSE("FALSE");
private String value;
ValueEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ValueEnum fromValue(String value) {
for (ValueEnum b : ValueEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ValueEnum> {
@Override
public void write(final JsonWriter jsonWriter, final ValueEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ValueEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ValueEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_VALUE = "value";
@SerializedName(SERIALIZED_NAME_VALUE)
private ValueEnum value;
public ConditionOption() {
}
public ConditionOption condition(ConditionEnum condition) {
this.condition = condition;
return this;
}
/**
* Condition of an email object that can be used to filter results
* @return condition
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Condition of an email object that can be used to filter results")
public ConditionEnum getCondition() {
return condition;
}
public void setCondition(ConditionEnum condition) {
this.condition = condition;
}
public ConditionOption value(ValueEnum value) {
this.value = value;
return this;
}
/**
* Expected condition value
* @return value
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Expected condition value")
public ValueEnum getValue() {
return value;
}
public void setValue(ValueEnum value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConditionOption conditionOption = (ConditionOption) o;
return Objects.equals(this.condition, conditionOption.condition) &&
Objects.equals(this.value, conditionOption.value);
}
@Override
public int hashCode() {
return Objects.hash(condition, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConditionOption {\n");
sb.append(" condition: ").append(toIndentedString(condition)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("condition");
openapiFields.add("value");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("condition");
openapiRequiredFields.add("value");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ConditionOption
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!ConditionOption.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in ConditionOption is not found in the empty JSON string", ConditionOption.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!ConditionOption.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConditionOption` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConditionOption.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("condition").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `condition` to be a primitive type in the JSON string but got `%s`", jsonObj.get("condition").toString()));
}
if (!jsonObj.get("value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ConditionOption.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ConditionOption' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ConditionOption> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ConditionOption.class));
return (TypeAdapter<T>) new TypeAdapter<ConditionOption>() {
@Override
public void write(JsonWriter out, ConditionOption value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public ConditionOption read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of ConditionOption given an JSON string
*
* @param jsonString JSON string
* @return An instance of ConditionOption
* @throws IOException if the JSON string is invalid with respect to ConditionOption
*/
public static ConditionOption fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ConditionOption.class);
}
/**
* Convert an instance of ConditionOption to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Complaint
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Complaint {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType";
@SerializedName(SERIALIZED_NAME_EVENT_TYPE)
private String eventType;
public static final String SERIALIZED_NAME_MAIL_SOURCE = "mailSource";
@SerializedName(SERIALIZED_NAME_MAIL_SOURCE)
private String mailSource;
public static final String SERIALIZED_NAME_MAIL_MESSAGE_ID = "mailMessageId";
@SerializedName(SERIALIZED_NAME_MAIL_MESSAGE_ID)
private String mailMessageId;
public static final String SERIALIZED_NAME_COMPLAINT_RECIPIENT = "complaintRecipient";
@SerializedName(SERIALIZED_NAME_COMPLAINT_RECIPIENT)
private String complaintRecipient;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public Complaint() {
}
public Complaint id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public Complaint userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public Complaint eventType(String eventType) {
this.eventType = eventType;
return this;
}
/**
* Get eventType
* @return eventType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getEventType() {
return eventType;
}
public void setEventType(String eventType) {
this.eventType = eventType;
}
public Complaint mailSource(String mailSource) {
this.mailSource = mailSource;
return this;
}
/**
* Get mailSource
* @return mailSource
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMailSource() {
return mailSource;
}
public void setMailSource(String mailSource) {
this.mailSource = mailSource;
}
public Complaint mailMessageId(String mailMessageId) {
this.mailMessageId = mailMessageId;
return this;
}
/**
* Get mailMessageId
* @return mailMessageId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getMailMessageId() {
return mailMessageId;
}
public void setMailMessageId(String mailMessageId) {
this.mailMessageId = mailMessageId;
}
public Complaint complaintRecipient(String complaintRecipient) {
this.complaintRecipient = complaintRecipient;
return this;
}
/**
* Get complaintRecipient
* @return complaintRecipient
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getComplaintRecipient() {
return complaintRecipient;
}
public void setComplaintRecipient(String complaintRecipient) {
this.complaintRecipient = complaintRecipient;
}
public Complaint createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public Complaint updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Complaint complaint = (Complaint) o;
return Objects.equals(this.id, complaint.id) &&
Objects.equals(this.userId, complaint.userId) &&
Objects.equals(this.eventType, complaint.eventType) &&
Objects.equals(this.mailSource, complaint.mailSource) &&
Objects.equals(this.mailMessageId, complaint.mailMessageId) &&
Objects.equals(this.complaintRecipient, complaint.complaintRecipient) &&
Objects.equals(this.createdAt, complaint.createdAt) &&
Objects.equals(this.updatedAt, complaint.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, userId, eventType, mailSource, mailMessageId, complaintRecipient, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Complaint {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n");
sb.append(" mailSource: ").append(toIndentedString(mailSource)).append("\n");
sb.append(" mailMessageId: ").append(toIndentedString(mailMessageId)).append("\n");
sb.append(" complaintRecipient: ").append(toIndentedString(complaintRecipient)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("eventType");
openapiFields.add("mailSource");
openapiFields.add("mailMessageId");
openapiFields.add("complaintRecipient");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("complaintRecipient");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to Complaint
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!Complaint.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Complaint is not found in the empty JSON string", Complaint.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!Complaint.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Complaint` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Complaint.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonNull()) && !jsonObj.get("eventType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventType").toString()));
}
if ((jsonObj.get("mailSource") != null && !jsonObj.get("mailSource").isJsonNull()) && !jsonObj.get("mailSource").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `mailSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mailSource").toString()));
}
if ((jsonObj.get("mailMessageId") != null && !jsonObj.get("mailMessageId").isJsonNull()) && !jsonObj.get("mailMessageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `mailMessageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mailMessageId").toString()));
}
if (!jsonObj.get("complaintRecipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `complaintRecipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("complaintRecipient").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!Complaint.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'Complaint' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Complaint> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(Complaint.class));
return (TypeAdapter<T>) new TypeAdapter<Complaint>() {
@Override
public void write(JsonWriter out, Complaint value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public Complaint read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of Complaint given an JSON string
*
* @param jsonString JSON string
* @return An instance of Complaint
* @throws IOException if the JSON string is invalid with respect to Complaint
*/
public static Complaint fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Complaint.class);
}
/**
* Convert an instance of Complaint to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.SendEmailOptions;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Options for bulk sending an email from multiple addresses. See regular `sendEmail` methods for more information.
*/
@ApiModel(description = "Options for bulk sending an email from multiple addresses. See regular `sendEmail` methods for more information.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class BulkSendEmailOptions {
public static final String SERIALIZED_NAME_INBOX_IDS = "inboxIds";
@SerializedName(SERIALIZED_NAME_INBOX_IDS)
private List<UUID> inboxIds = new ArrayList<>();
public static final String SERIALIZED_NAME_SEND_EMAIL_OPTIONS = "sendEmailOptions";
@SerializedName(SERIALIZED_NAME_SEND_EMAIL_OPTIONS)
private SendEmailOptions sendEmailOptions;
public BulkSendEmailOptions() {
}
public BulkSendEmailOptions inboxIds(List<UUID> inboxIds) {
this.inboxIds = inboxIds;
return this;
}
public BulkSendEmailOptions addInboxIdsItem(UUID inboxIdsItem) {
this.inboxIds.add(inboxIdsItem);
return this;
}
/**
* Inboxes to send the email from
* @return inboxIds
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inboxes to send the email from")
public List<UUID> getInboxIds() {
return inboxIds;
}
public void setInboxIds(List<UUID> inboxIds) {
this.inboxIds = inboxIds;
}
public BulkSendEmailOptions sendEmailOptions(SendEmailOptions sendEmailOptions) {
this.sendEmailOptions = sendEmailOptions;
return this;
}
/**
* Get sendEmailOptions
* @return sendEmailOptions
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public SendEmailOptions getSendEmailOptions() {
return sendEmailOptions;
}
public void setSendEmailOptions(SendEmailOptions sendEmailOptions) {
this.sendEmailOptions = sendEmailOptions;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BulkSendEmailOptions bulkSendEmailOptions = (BulkSendEmailOptions) o;
return Objects.equals(this.inboxIds, bulkSendEmailOptions.inboxIds) &&
Objects.equals(this.sendEmailOptions, bulkSendEmailOptions.sendEmailOptions);
}
@Override
public int hashCode() {
return Objects.hash(inboxIds, sendEmailOptions);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BulkSendEmailOptions {\n");
sb.append(" inboxIds: ").append(toIndentedString(inboxIds)).append("\n");
sb.append(" sendEmailOptions: ").append(toIndentedString(sendEmailOptions)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("inboxIds");
openapiFields.add("sendEmailOptions");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("inboxIds");
openapiRequiredFields.add("sendEmailOptions");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to BulkSendEmailOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!BulkSendEmailOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BulkSendEmailOptions is not found in the empty JSON string", BulkSendEmailOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!BulkSendEmailOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BulkSendEmailOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BulkSendEmailOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
// ensure the required json array is present
if (jsonObj.get("inboxIds") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("inboxIds").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxIds` to be an array in the JSON string but got `%s`", jsonObj.get("inboxIds").toString()));
}
// validate the required field `sendEmailOptions`
SendEmailOptions.validateJsonObject(jsonObj.getAsJsonObject("sendEmailOptions"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!BulkSendEmailOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'BulkSendEmailOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<BulkSendEmailOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(BulkSendEmailOptions.class));
return (TypeAdapter<T>) new TypeAdapter<BulkSendEmailOptions>() {
@Override
public void write(JsonWriter out, BulkSendEmailOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public BulkSendEmailOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of BulkSendEmailOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of BulkSendEmailOptions
* @throws IOException if the JSON string is invalid with respect to BulkSendEmailOptions
*/
public static BulkSendEmailOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, BulkSendEmailOptions.class);
}
/**
* Convert an instance of BulkSendEmailOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Bounced recipient
*/
@ApiModel(description = "Bounced recipient")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class BouncedRecipientDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_SENT_EMAIL_ID = "sentEmailId";
@SerializedName(SERIALIZED_NAME_SENT_EMAIL_ID)
private UUID sentEmailId;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public static final String SERIALIZED_NAME_DIAGNOSTIC_CODE = "diagnosticCode";
@SerializedName(SERIALIZED_NAME_DIAGNOSTIC_CODE)
private String diagnosticCode;
public static final String SERIALIZED_NAME_ACTION = "action";
@SerializedName(SERIALIZED_NAME_ACTION)
private String action;
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private String status;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public BouncedRecipientDto() {
}
public BouncedRecipientDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public BouncedRecipientDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public BouncedRecipientDto sentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
return this;
}
/**
* Get sentEmailId
* @return sentEmailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentEmailId() {
return sentEmailId;
}
public void setSentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
}
public BouncedRecipientDto recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Get recipient
* @return recipient
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
public BouncedRecipientDto diagnosticCode(String diagnosticCode) {
this.diagnosticCode = diagnosticCode;
return this;
}
/**
* Get diagnosticCode
* @return diagnosticCode
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDiagnosticCode() {
return diagnosticCode;
}
public void setDiagnosticCode(String diagnosticCode) {
this.diagnosticCode = diagnosticCode;
}
public BouncedRecipientDto action(String action) {
this.action = action;
return this;
}
/**
* Get action
* @return action
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public BouncedRecipientDto status(String status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public BouncedRecipientDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BouncedRecipientDto bouncedRecipientDto = (BouncedRecipientDto) o;
return Objects.equals(this.id, bouncedRecipientDto.id) &&
Objects.equals(this.userId, bouncedRecipientDto.userId) &&
Objects.equals(this.sentEmailId, bouncedRecipientDto.sentEmailId) &&
Objects.equals(this.recipient, bouncedRecipientDto.recipient) &&
Objects.equals(this.diagnosticCode, bouncedRecipientDto.diagnosticCode) &&
Objects.equals(this.action, bouncedRecipientDto.action) &&
Objects.equals(this.status, bouncedRecipientDto.status) &&
Objects.equals(this.createdAt, bouncedRecipientDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, sentEmailId, recipient, diagnosticCode, action, status, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BouncedRecipientDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" sentEmailId: ").append(toIndentedString(sentEmailId)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n");
sb.append(" diagnosticCode: ").append(toIndentedString(diagnosticCode)).append("\n");
sb.append(" action: ").append(toIndentedString(action)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("sentEmailId");
openapiFields.add("recipient");
openapiFields.add("diagnosticCode");
openapiFields.add("action");
openapiFields.add("status");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("recipient");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to BouncedRecipientDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!BouncedRecipientDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BouncedRecipientDto is not found in the empty JSON string", BouncedRecipientDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!BouncedRecipientDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BouncedRecipientDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BouncedRecipientDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("sentEmailId") != null && !jsonObj.get("sentEmailId").isJsonNull()) && !jsonObj.get("sentEmailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentEmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentEmailId").toString()));
}
if (!jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
if ((jsonObj.get("diagnosticCode") != null && !jsonObj.get("diagnosticCode").isJsonNull()) && !jsonObj.get("diagnosticCode").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `diagnosticCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diagnosticCode").toString()));
}
if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!BouncedRecipientDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'BouncedRecipientDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<BouncedRecipientDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(BouncedRecipientDto.class));
return (TypeAdapter<T>) new TypeAdapter<BouncedRecipientDto>() {
@Override
public void write(JsonWriter out, BouncedRecipientDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public BouncedRecipientDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of BouncedRecipientDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of BouncedRecipientDto
* @throws IOException if the JSON string is invalid with respect to BouncedRecipientDto
*/
public static BouncedRecipientDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, BouncedRecipientDto.class);
}
/**
* Convert an instance of BouncedRecipientDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Bounced email
*/
@ApiModel(description = "Bounced email")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class BouncedEmailDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_NOTIFICATION_TYPE = "notificationType";
@SerializedName(SERIALIZED_NAME_NOTIFICATION_TYPE)
private String notificationType;
public static final String SERIALIZED_NAME_SENT_TO_RECIPIENTS = "sentToRecipients";
@SerializedName(SERIALIZED_NAME_SENT_TO_RECIPIENTS)
private List<String> sentToRecipients = null;
public static final String SERIALIZED_NAME_SENDER = "sender";
@SerializedName(SERIALIZED_NAME_SENDER)
private String sender;
public static final String SERIALIZED_NAME_BOUNCE_MTA = "bounceMta";
@SerializedName(SERIALIZED_NAME_BOUNCE_MTA)
private String bounceMta;
public static final String SERIALIZED_NAME_BOUNCE_TYPE = "bounceType";
@SerializedName(SERIALIZED_NAME_BOUNCE_TYPE)
private String bounceType;
public static final String SERIALIZED_NAME_BOUNCE_RECIPIENTS = "bounceRecipients";
@SerializedName(SERIALIZED_NAME_BOUNCE_RECIPIENTS)
private List<String> bounceRecipients = null;
public static final String SERIALIZED_NAME_BOUNCE_SUB_TYPE = "bounceSubType";
@SerializedName(SERIALIZED_NAME_BOUNCE_SUB_TYPE)
private String bounceSubType;
public static final String SERIALIZED_NAME_SENT_EMAIL_ID = "sentEmailId";
@SerializedName(SERIALIZED_NAME_SENT_EMAIL_ID)
private UUID sentEmailId;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public BouncedEmailDto() {
}
public BouncedEmailDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public BouncedEmailDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public BouncedEmailDto notificationType(String notificationType) {
this.notificationType = notificationType;
return this;
}
/**
* Get notificationType
* @return notificationType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getNotificationType() {
return notificationType;
}
public void setNotificationType(String notificationType) {
this.notificationType = notificationType;
}
public BouncedEmailDto sentToRecipients(List<String> sentToRecipients) {
this.sentToRecipients = sentToRecipients;
return this;
}
public BouncedEmailDto addSentToRecipientsItem(String sentToRecipientsItem) {
if (this.sentToRecipients == null) {
this.sentToRecipients = new ArrayList<>();
}
this.sentToRecipients.add(sentToRecipientsItem);
return this;
}
/**
* Get sentToRecipients
* @return sentToRecipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getSentToRecipients() {
return sentToRecipients;
}
public void setSentToRecipients(List<String> sentToRecipients) {
this.sentToRecipients = sentToRecipients;
}
public BouncedEmailDto sender(String sender) {
this.sender = sender;
return this;
}
/**
* Get sender
* @return sender
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public BouncedEmailDto bounceMta(String bounceMta) {
this.bounceMta = bounceMta;
return this;
}
/**
* Get bounceMta
* @return bounceMta
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBounceMta() {
return bounceMta;
}
public void setBounceMta(String bounceMta) {
this.bounceMta = bounceMta;
}
public BouncedEmailDto bounceType(String bounceType) {
this.bounceType = bounceType;
return this;
}
/**
* Get bounceType
* @return bounceType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBounceType() {
return bounceType;
}
public void setBounceType(String bounceType) {
this.bounceType = bounceType;
}
public BouncedEmailDto bounceRecipients(List<String> bounceRecipients) {
this.bounceRecipients = bounceRecipients;
return this;
}
public BouncedEmailDto addBounceRecipientsItem(String bounceRecipientsItem) {
if (this.bounceRecipients == null) {
this.bounceRecipients = new ArrayList<>();
}
this.bounceRecipients.add(bounceRecipientsItem);
return this;
}
/**
* Get bounceRecipients
* @return bounceRecipients
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<String> getBounceRecipients() {
return bounceRecipients;
}
public void setBounceRecipients(List<String> bounceRecipients) {
this.bounceRecipients = bounceRecipients;
}
public BouncedEmailDto bounceSubType(String bounceSubType) {
this.bounceSubType = bounceSubType;
return this;
}
/**
* Get bounceSubType
* @return bounceSubType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBounceSubType() {
return bounceSubType;
}
public void setBounceSubType(String bounceSubType) {
this.bounceSubType = bounceSubType;
}
public BouncedEmailDto sentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
return this;
}
/**
* Get sentEmailId
* @return sentEmailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentEmailId() {
return sentEmailId;
}
public void setSentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
}
public BouncedEmailDto subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public BouncedEmailDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BouncedEmailDto bouncedEmailDto = (BouncedEmailDto) o;
return Objects.equals(this.id, bouncedEmailDto.id) &&
Objects.equals(this.userId, bouncedEmailDto.userId) &&
Objects.equals(this.notificationType, bouncedEmailDto.notificationType) &&
Objects.equals(this.sentToRecipients, bouncedEmailDto.sentToRecipients) &&
Objects.equals(this.sender, bouncedEmailDto.sender) &&
Objects.equals(this.bounceMta, bouncedEmailDto.bounceMta) &&
Objects.equals(this.bounceType, bouncedEmailDto.bounceType) &&
Objects.equals(this.bounceRecipients, bouncedEmailDto.bounceRecipients) &&
Objects.equals(this.bounceSubType, bouncedEmailDto.bounceSubType) &&
Objects.equals(this.sentEmailId, bouncedEmailDto.sentEmailId) &&
Objects.equals(this.subject, bouncedEmailDto.subject) &&
Objects.equals(this.createdAt, bouncedEmailDto.createdAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, userId, notificationType, sentToRecipients, sender, bounceMta, bounceType, bounceRecipients, bounceSubType, sentEmailId, subject, createdAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BouncedEmailDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" notificationType: ").append(toIndentedString(notificationType)).append("\n");
sb.append(" sentToRecipients: ").append(toIndentedString(sentToRecipients)).append("\n");
sb.append(" sender: ").append(toIndentedString(sender)).append("\n");
sb.append(" bounceMta: ").append(toIndentedString(bounceMta)).append("\n");
sb.append(" bounceType: ").append(toIndentedString(bounceType)).append("\n");
sb.append(" bounceRecipients: ").append(toIndentedString(bounceRecipients)).append("\n");
sb.append(" bounceSubType: ").append(toIndentedString(bounceSubType)).append("\n");
sb.append(" sentEmailId: ").append(toIndentedString(sentEmailId)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("userId");
openapiFields.add("notificationType");
openapiFields.add("sentToRecipients");
openapiFields.add("sender");
openapiFields.add("bounceMta");
openapiFields.add("bounceType");
openapiFields.add("bounceRecipients");
openapiFields.add("bounceSubType");
openapiFields.add("sentEmailId");
openapiFields.add("subject");
openapiFields.add("createdAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("notificationType");
openapiRequiredFields.add("sender");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to BouncedEmailDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!BouncedEmailDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BouncedEmailDto is not found in the empty JSON string", BouncedEmailDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!BouncedEmailDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BouncedEmailDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BouncedEmailDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("notificationType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `notificationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationType").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("sentToRecipients") != null && !jsonObj.get("sentToRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `sentToRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("sentToRecipients").toString()));
}
if (!jsonObj.get("sender").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sender").toString()));
}
if ((jsonObj.get("bounceMta") != null && !jsonObj.get("bounceMta").isJsonNull()) && !jsonObj.get("bounceMta").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceMta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bounceMta").toString()));
}
if ((jsonObj.get("bounceType") != null && !jsonObj.get("bounceType").isJsonNull()) && !jsonObj.get("bounceType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bounceType").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("bounceRecipients") != null && !jsonObj.get("bounceRecipients").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceRecipients` to be an array in the JSON string but got `%s`", jsonObj.get("bounceRecipients").toString()));
}
if ((jsonObj.get("bounceSubType") != null && !jsonObj.get("bounceSubType").isJsonNull()) && !jsonObj.get("bounceSubType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceSubType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bounceSubType").toString()));
}
if ((jsonObj.get("sentEmailId") != null && !jsonObj.get("sentEmailId").isJsonNull()) && !jsonObj.get("sentEmailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentEmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentEmailId").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!BouncedEmailDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'BouncedEmailDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<BouncedEmailDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(BouncedEmailDto.class));
return (TypeAdapter<T>) new TypeAdapter<BouncedEmailDto>() {
@Override
public void write(JsonWriter out, BouncedEmailDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public BouncedEmailDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of BouncedEmailDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of BouncedEmailDto
* @throws IOException if the JSON string is invalid with respect to BouncedEmailDto
*/
public static BouncedEmailDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, BouncedEmailDto.class);
}
/**
* Convert an instance of BouncedEmailDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Bounced recipient
*/
@ApiModel(description = "Bounced recipient")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class BounceRecipientProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private String status;
public static final String SERIALIZED_NAME_SENT_EMAIL_ID = "sentEmailId";
@SerializedName(SERIALIZED_NAME_SENT_EMAIL_ID)
private UUID sentEmailId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_RECIPIENT = "recipient";
@SerializedName(SERIALIZED_NAME_RECIPIENT)
private String recipient;
public static final String SERIALIZED_NAME_ACTION = "action";
@SerializedName(SERIALIZED_NAME_ACTION)
private String action;
public BounceRecipientProjection() {
}
public BounceRecipientProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public BounceRecipientProjection status(String status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public BounceRecipientProjection sentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
return this;
}
/**
* Get sentEmailId
* @return sentEmailId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getSentEmailId() {
return sentEmailId;
}
public void setSentEmailId(UUID sentEmailId) {
this.sentEmailId = sentEmailId;
}
public BounceRecipientProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public BounceRecipientProjection recipient(String recipient) {
this.recipient = recipient;
return this;
}
/**
* Get recipient
* @return recipient
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getRecipient() {
return recipient;
}
public void setRecipient(String recipient) {
this.recipient = recipient;
}
public BounceRecipientProjection action(String action) {
this.action = action;
return this;
}
/**
* Get action
* @return action
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BounceRecipientProjection bounceRecipientProjection = (BounceRecipientProjection) o;
return Objects.equals(this.id, bounceRecipientProjection.id) &&
Objects.equals(this.status, bounceRecipientProjection.status) &&
Objects.equals(this.sentEmailId, bounceRecipientProjection.sentEmailId) &&
Objects.equals(this.createdAt, bounceRecipientProjection.createdAt) &&
Objects.equals(this.recipient, bounceRecipientProjection.recipient) &&
Objects.equals(this.action, bounceRecipientProjection.action);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, status, sentEmailId, createdAt, recipient, action);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BounceRecipientProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" sentEmailId: ").append(toIndentedString(sentEmailId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n");
sb.append(" action: ").append(toIndentedString(action)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("status");
openapiFields.add("sentEmailId");
openapiFields.add("createdAt");
openapiFields.add("recipient");
openapiFields.add("action");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("recipient");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to BounceRecipientProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!BounceRecipientProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BounceRecipientProjection is not found in the empty JSON string", BounceRecipientProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!BounceRecipientProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BounceRecipientProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BounceRecipientProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
if ((jsonObj.get("sentEmailId") != null && !jsonObj.get("sentEmailId").isJsonNull()) && !jsonObj.get("sentEmailId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sentEmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sentEmailId").toString()));
}
if (!jsonObj.get("recipient").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `recipient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipient").toString()));
}
if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!BounceRecipientProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'BounceRecipientProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<BounceRecipientProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(BounceRecipientProjection.class));
return (TypeAdapter<T>) new TypeAdapter<BounceRecipientProjection>() {
@Override
public void write(JsonWriter out, BounceRecipientProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public BounceRecipientProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of BounceRecipientProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of BounceRecipientProjection
* @throws IOException if the JSON string is invalid with respect to BounceRecipientProjection
*/
public static BounceRecipientProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, BounceRecipientProjection.class);
}
/**
* Convert an instance of BounceRecipientProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Bounced email event
*/
@ApiModel(description = "Bounced email event")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class BounceProjection {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_SUBJECT = "subject";
@SerializedName(SERIALIZED_NAME_SUBJECT)
private String subject;
public static final String SERIALIZED_NAME_SENDER = "sender";
@SerializedName(SERIALIZED_NAME_SENDER)
private String sender;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_BOUNCE_TYPE = "bounceType";
@SerializedName(SERIALIZED_NAME_BOUNCE_TYPE)
private String bounceType;
public static final String SERIALIZED_NAME_BOUNCE_MTA = "bounceMta";
@SerializedName(SERIALIZED_NAME_BOUNCE_MTA)
private String bounceMta;
public BounceProjection() {
}
public BounceProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public BounceProjection subject(String subject) {
this.subject = subject;
return this;
}
/**
* Get subject
* @return subject
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public BounceProjection sender(String sender) {
this.sender = sender;
return this;
}
/**
* Get sender
* @return sender
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public BounceProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public BounceProjection bounceType(String bounceType) {
this.bounceType = bounceType;
return this;
}
/**
* Get bounceType
* @return bounceType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBounceType() {
return bounceType;
}
public void setBounceType(String bounceType) {
this.bounceType = bounceType;
}
public BounceProjection bounceMta(String bounceMta) {
this.bounceMta = bounceMta;
return this;
}
/**
* Get bounceMta
* @return bounceMta
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBounceMta() {
return bounceMta;
}
public void setBounceMta(String bounceMta) {
this.bounceMta = bounceMta;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BounceProjection bounceProjection = (BounceProjection) o;
return Objects.equals(this.id, bounceProjection.id) &&
Objects.equals(this.subject, bounceProjection.subject) &&
Objects.equals(this.sender, bounceProjection.sender) &&
Objects.equals(this.createdAt, bounceProjection.createdAt) &&
Objects.equals(this.bounceType, bounceProjection.bounceType) &&
Objects.equals(this.bounceMta, bounceProjection.bounceMta);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, subject, sender, createdAt, bounceType, bounceMta);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BounceProjection {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
sb.append(" sender: ").append(toIndentedString(sender)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" bounceType: ").append(toIndentedString(bounceType)).append("\n");
sb.append(" bounceMta: ").append(toIndentedString(bounceMta)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("subject");
openapiFields.add("sender");
openapiFields.add("createdAt");
openapiFields.add("bounceType");
openapiFields.add("bounceMta");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("sender");
openapiRequiredFields.add("createdAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to BounceProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!BounceProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BounceProjection is not found in the empty JSON string", BounceProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!BounceProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BounceProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BounceProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonNull()) && !jsonObj.get("subject").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString()));
}
if (!jsonObj.get("sender").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sender").toString()));
}
if ((jsonObj.get("bounceType") != null && !jsonObj.get("bounceType").isJsonNull()) && !jsonObj.get("bounceType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bounceType").toString()));
}
if ((jsonObj.get("bounceMta") != null && !jsonObj.get("bounceMta").isJsonNull()) && !jsonObj.get("bounceMta").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bounceMta` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bounceMta").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!BounceProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'BounceProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<BounceProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(BounceProjection.class));
return (TypeAdapter<T>) new TypeAdapter<BounceProjection>() {
@Override
public void write(JsonWriter out, BounceProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public BounceProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of BounceProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of BounceProjection
* @throws IOException if the JSON string is invalid with respect to BounceProjection
*/
public static BounceProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, BounceProjection.class);
}
/**
* Convert an instance of BounceProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Basic Authentication options for webhooks. Will be used is present when calling webhook endpoints.
*/
@ApiModel(description = "Basic Authentication options for webhooks. Will be used is present when calling webhook endpoints.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class BasicAuthOptions {
public static final String SERIALIZED_NAME_USERNAME = "username";
@SerializedName(SERIALIZED_NAME_USERNAME)
private String username;
public static final String SERIALIZED_NAME_PASSWORD = "password";
@SerializedName(SERIALIZED_NAME_PASSWORD)
private String password;
public BasicAuthOptions() {
}
public BasicAuthOptions username(String username) {
this.username = username;
return this;
}
/**
* Get username
* @return username
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public BasicAuthOptions password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BasicAuthOptions basicAuthOptions = (BasicAuthOptions) o;
return Objects.equals(this.username, basicAuthOptions.username) &&
Objects.equals(this.password, basicAuthOptions.password);
}
@Override
public int hashCode() {
return Objects.hash(username, password);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BasicAuthOptions {\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("username");
openapiFields.add("password");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("username");
openapiRequiredFields.add("password");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to BasicAuthOptions
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!BasicAuthOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in BasicAuthOptions is not found in the empty JSON string", BasicAuthOptions.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!BasicAuthOptions.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BasicAuthOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BasicAuthOptions.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("username").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString()));
}
if (!jsonObj.get("password").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!BasicAuthOptions.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'BasicAuthOptions' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<BasicAuthOptions> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(BasicAuthOptions.class));
return (TypeAdapter<T>) new TypeAdapter<BasicAuthOptions>() {
@Override
public void write(JsonWriter out, BasicAuthOptions value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public BasicAuthOptions read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of BasicAuthOptions given an JSON string
*
* @param jsonString JSON string
* @return An instance of BasicAuthOptions
* @throws IOException if the JSON string is invalid with respect to BasicAuthOptions
*/
public static BasicAuthOptions fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, BasicAuthOptions.class);
}
/**
* Convert an instance of BasicAuthOptions to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email attachment data
*/
@ApiModel(description = "Email attachment data")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class AttachmentProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CONTENT_LENGTH = "contentLength";
@SerializedName(SERIALIZED_NAME_CONTENT_LENGTH)
private Long contentLength;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_ATTACHMENT_ID = "attachmentId";
@SerializedName(SERIALIZED_NAME_ATTACHMENT_ID)
private String attachmentId;
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public AttachmentProjection() {
}
public AttachmentProjection name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public AttachmentProjection contentLength(Long contentLength) {
this.contentLength = contentLength;
return this;
}
/**
* Content length of attachment in bytes
* @return contentLength
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Content length of attachment in bytes")
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
public AttachmentProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public AttachmentProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public AttachmentProjection updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public AttachmentProjection attachmentId(String attachmentId) {
this.attachmentId = attachmentId;
return this;
}
/**
* Attachment ID
* @return attachmentId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Attachment ID")
public String getAttachmentId() {
return attachmentId;
}
public void setAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
}
public AttachmentProjection contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Content type of attachment.
* @return contentType
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "image/png", value = "Content type of attachment.")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AttachmentProjection attachmentProjection = (AttachmentProjection) o;
return Objects.equals(this.name, attachmentProjection.name) &&
Objects.equals(this.contentLength, attachmentProjection.contentLength) &&
Objects.equals(this.userId, attachmentProjection.userId) &&
Objects.equals(this.createdAt, attachmentProjection.createdAt) &&
Objects.equals(this.updatedAt, attachmentProjection.updatedAt) &&
Objects.equals(this.attachmentId, attachmentProjection.attachmentId) &&
Objects.equals(this.contentType, attachmentProjection.contentType);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(name, contentLength, userId, createdAt, updatedAt, attachmentId, contentType);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AttachmentProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" contentLength: ").append(toIndentedString(contentLength)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" attachmentId: ").append(toIndentedString(attachmentId)).append("\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("contentLength");
openapiFields.add("userId");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("attachmentId");
openapiFields.add("contentType");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
openapiRequiredFields.add("attachmentId");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to AttachmentProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!AttachmentProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AttachmentProjection is not found in the empty JSON string", AttachmentProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AttachmentProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AttachmentProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AttachmentProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("attachmentId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `attachmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attachmentId").toString()));
}
if ((jsonObj.get("contentType") != null && !jsonObj.get("contentType").isJsonNull()) && !jsonObj.get("contentType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AttachmentProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AttachmentProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AttachmentProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AttachmentProjection.class));
return (TypeAdapter<T>) new TypeAdapter<AttachmentProjection>() {
@Override
public void write(JsonWriter out, AttachmentProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AttachmentProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of AttachmentProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of AttachmentProjection
* @throws IOException if the JSON string is invalid with respect to AttachmentProjection
*/
public static AttachmentProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AttachmentProjection.class);
}
/**
* Convert an instance of AttachmentProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Meta data associated with an attachment. Attachments are stored as byte blobs so the meta data is stored separately.
*/
@ApiModel(description = "Meta data associated with an attachment. Attachments are stored as byte blobs so the meta data is stored separately.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class AttachmentMetaData {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public static final String SERIALIZED_NAME_CONTENT_LENGTH = "contentLength";
@SerializedName(SERIALIZED_NAME_CONTENT_LENGTH)
private Long contentLength;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public AttachmentMetaData() {
}
public AttachmentMetaData name(String name) {
this.name = name;
return this;
}
/**
* Name of attachment if given
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Name of attachment if given")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public AttachmentMetaData contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Content type of attachment such as `image/png`
* @return contentType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Content type of attachment such as `image/png`")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public AttachmentMetaData contentLength(Long contentLength) {
this.contentLength = contentLength;
return this;
}
/**
* Size of attachment in bytes
* @return contentLength
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Size of attachment in bytes")
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
public AttachmentMetaData id(String id) {
this.id = id;
return this;
}
/**
* ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email.
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email.")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AttachmentMetaData attachmentMetaData = (AttachmentMetaData) o;
return Objects.equals(this.name, attachmentMetaData.name) &&
Objects.equals(this.contentType, attachmentMetaData.contentType) &&
Objects.equals(this.contentLength, attachmentMetaData.contentLength) &&
Objects.equals(this.id, attachmentMetaData.id);
}
@Override
public int hashCode() {
return Objects.hash(name, contentType, contentLength, id);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AttachmentMetaData {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
sb.append(" contentLength: ").append(toIndentedString(contentLength)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("contentType");
openapiFields.add("contentLength");
openapiFields.add("id");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("name");
openapiRequiredFields.add("contentType");
openapiRequiredFields.add("contentLength");
openapiRequiredFields.add("id");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to AttachmentMetaData
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!AttachmentMetaData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AttachmentMetaData is not found in the empty JSON string", AttachmentMetaData.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AttachmentMetaData.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AttachmentMetaData` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AttachmentMetaData.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("contentType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AttachmentMetaData.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AttachmentMetaData' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AttachmentMetaData> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AttachmentMetaData.class));
return (TypeAdapter<T>) new TypeAdapter<AttachmentMetaData>() {
@Override
public void write(JsonWriter out, AttachmentMetaData value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AttachmentMetaData read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of AttachmentMetaData given an JSON string
*
* @param jsonString JSON string
* @return An instance of AttachmentMetaData
* @throws IOException if the JSON string is invalid with respect to AttachmentMetaData
*/
public static AttachmentMetaData fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AttachmentMetaData.class);
}
/**
* Convert an instance of AttachmentMetaData to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* AttachmentEntity
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class AttachmentEntity {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_ATTACHMENT_ID = "attachmentId";
@SerializedName(SERIALIZED_NAME_ATTACHMENT_ID)
private String attachmentId;
public static final String SERIALIZED_NAME_BUCKET = "bucket";
@SerializedName(SERIALIZED_NAME_BUCKET)
private String bucket;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType";
@SerializedName(SERIALIZED_NAME_CONTENT_TYPE)
private String contentType;
public static final String SERIALIZED_NAME_CONTENT_LENGTH = "contentLength";
@SerializedName(SERIALIZED_NAME_CONTENT_LENGTH)
private Long contentLength;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public AttachmentEntity() {
}
public AttachmentEntity id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public AttachmentEntity attachmentId(String attachmentId) {
this.attachmentId = attachmentId;
return this;
}
/**
* Get attachmentId
* @return attachmentId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getAttachmentId() {
return attachmentId;
}
public void setAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
}
public AttachmentEntity bucket(String bucket) {
this.bucket = bucket;
return this;
}
/**
* Get bucket
* @return bucket
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getBucket() {
return bucket;
}
public void setBucket(String bucket) {
this.bucket = bucket;
}
public AttachmentEntity userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public AttachmentEntity contentType(String contentType) {
this.contentType = contentType;
return this;
}
/**
* Get contentType
* @return contentType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public AttachmentEntity contentLength(Long contentLength) {
this.contentLength = contentLength;
return this;
}
/**
* Get contentLength
* @return contentLength
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
public AttachmentEntity name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public AttachmentEntity createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public AttachmentEntity updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AttachmentEntity attachmentEntity = (AttachmentEntity) o;
return Objects.equals(this.id, attachmentEntity.id) &&
Objects.equals(this.attachmentId, attachmentEntity.attachmentId) &&
Objects.equals(this.bucket, attachmentEntity.bucket) &&
Objects.equals(this.userId, attachmentEntity.userId) &&
Objects.equals(this.contentType, attachmentEntity.contentType) &&
Objects.equals(this.contentLength, attachmentEntity.contentLength) &&
Objects.equals(this.name, attachmentEntity.name) &&
Objects.equals(this.createdAt, attachmentEntity.createdAt) &&
Objects.equals(this.updatedAt, attachmentEntity.updatedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, attachmentId, bucket, userId, contentType, contentLength, name, createdAt, updatedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AttachmentEntity {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" attachmentId: ").append(toIndentedString(attachmentId)).append("\n");
sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
sb.append(" contentLength: ").append(toIndentedString(contentLength)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("attachmentId");
openapiFields.add("bucket");
openapiFields.add("userId");
openapiFields.add("contentType");
openapiFields.add("contentLength");
openapiFields.add("name");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("attachmentId");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to AttachmentEntity
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!AttachmentEntity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AttachmentEntity is not found in the empty JSON string", AttachmentEntity.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AttachmentEntity.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AttachmentEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AttachmentEntity.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("attachmentId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `attachmentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attachmentId").toString()));
}
if ((jsonObj.get("bucket") != null && !jsonObj.get("bucket").isJsonNull()) && !jsonObj.get("bucket").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `bucket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bucket").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if ((jsonObj.get("contentType") != null && !jsonObj.get("contentType").isJsonNull()) && !jsonObj.get("contentType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AttachmentEntity.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AttachmentEntity' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AttachmentEntity> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AttachmentEntity.class));
return (TypeAdapter<T>) new TypeAdapter<AttachmentEntity>() {
@Override
public void write(JsonWriter out, AttachmentEntity value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AttachmentEntity read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of AttachmentEntity given an JSON string
*
* @param jsonString JSON string
* @return An instance of AttachmentEntity
* @throws IOException if the JSON string is invalid with respect to AttachmentEntity
*/
public static AttachmentEntity fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AttachmentEntity.class);
}
/**
* Convert an instance of AttachmentEntity to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Representation of a alias
*/
@ApiModel(description = "Representation of a alias")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class AliasProjection {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public static final String SERIALIZED_NAME_USE_THREADS = "useThreads";
@SerializedName(SERIALIZED_NAME_USE_THREADS)
private Boolean useThreads;
public AliasProjection() {
}
public AliasProjection name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public AliasProjection id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public AliasProjection inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Get inboxId
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public AliasProjection userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public AliasProjection emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* Get emailAddress
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public AliasProjection createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public AliasProjection updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
public AliasProjection useThreads(Boolean useThreads) {
this.useThreads = useThreads;
return this;
}
/**
* Get useThreads
* @return useThreads
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getUseThreads() {
return useThreads;
}
public void setUseThreads(Boolean useThreads) {
this.useThreads = useThreads;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AliasProjection aliasProjection = (AliasProjection) o;
return Objects.equals(this.name, aliasProjection.name) &&
Objects.equals(this.id, aliasProjection.id) &&
Objects.equals(this.inboxId, aliasProjection.inboxId) &&
Objects.equals(this.userId, aliasProjection.userId) &&
Objects.equals(this.emailAddress, aliasProjection.emailAddress) &&
Objects.equals(this.createdAt, aliasProjection.createdAt) &&
Objects.equals(this.updatedAt, aliasProjection.updatedAt) &&
Objects.equals(this.useThreads, aliasProjection.useThreads);
}
@Override
public int hashCode() {
return Objects.hash(name, id, inboxId, userId, emailAddress, createdAt, updatedAt, useThreads);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AliasProjection {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" useThreads: ").append(toIndentedString(useThreads)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("name");
openapiFields.add("id");
openapiFields.add("inboxId");
openapiFields.add("userId");
openapiFields.add("emailAddress");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
openapiFields.add("useThreads");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("createdAt");
openapiRequiredFields.add("updatedAt");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to AliasProjection
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!AliasProjection.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AliasProjection is not found in the empty JSON string", AliasProjection.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AliasProjection.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AliasProjection` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AliasProjection.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AliasProjection.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AliasProjection' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AliasProjection> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AliasProjection.class));
return (TypeAdapter<T>) new TypeAdapter<AliasProjection>() {
@Override
public void write(JsonWriter out, AliasProjection value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AliasProjection read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of AliasProjection given an JSON string
*
* @param jsonString JSON string
* @return An instance of AliasProjection
* @throws IOException if the JSON string is invalid with respect to AliasProjection
*/
public static AliasProjection fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AliasProjection.class);
}
/**
* Convert an instance of AliasProjection to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Email alias representation
*/
@ApiModel(description = "Email alias representation")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class AliasDto {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private UUID id;
public static final String SERIALIZED_NAME_EMAIL_ADDRESS = "emailAddress";
@SerializedName(SERIALIZED_NAME_EMAIL_ADDRESS)
private String emailAddress;
public static final String SERIALIZED_NAME_MASKED_EMAIL_ADDRESS = "maskedEmailAddress";
@SerializedName(SERIALIZED_NAME_MASKED_EMAIL_ADDRESS)
private String maskedEmailAddress;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private UUID userId;
public static final String SERIALIZED_NAME_INBOX_ID = "inboxId";
@SerializedName(SERIALIZED_NAME_INBOX_ID)
private UUID inboxId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_USE_THREADS = "useThreads";
@SerializedName(SERIALIZED_NAME_USE_THREADS)
private Boolean useThreads;
public static final String SERIALIZED_NAME_IS_VERIFIED = "isVerified";
@SerializedName(SERIALIZED_NAME_IS_VERIFIED)
private Boolean isVerified;
public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private OffsetDateTime updatedAt;
public AliasDto() {
}
public AliasDto id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public AliasDto emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* The alias's email address for receiving email
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The alias's email address for receiving email")
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public AliasDto maskedEmailAddress(String maskedEmailAddress) {
this.maskedEmailAddress = maskedEmailAddress;
return this;
}
/**
* The underlying email address that is hidden and will received forwarded email
* @return maskedEmailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The underlying email address that is hidden and will received forwarded email")
public String getMaskedEmailAddress() {
return maskedEmailAddress;
}
public void setMaskedEmailAddress(String maskedEmailAddress) {
this.maskedEmailAddress = maskedEmailAddress;
}
public AliasDto userId(UUID userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getUserId() {
return userId;
}
public void setUserId(UUID userId) {
this.userId = userId;
}
public AliasDto inboxId(UUID inboxId) {
this.inboxId = inboxId;
return this;
}
/**
* Inbox that is associated with the alias
* @return inboxId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Inbox that is associated with the alias")
public UUID getInboxId() {
return inboxId;
}
public void setInboxId(UUID inboxId) {
this.inboxId = inboxId;
}
public AliasDto name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public AliasDto useThreads(Boolean useThreads) {
this.useThreads = useThreads;
return this;
}
/**
* If alias will generate response threads or not when email are received by it
* @return useThreads
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "If alias will generate response threads or not when email are received by it")
public Boolean getUseThreads() {
return useThreads;
}
public void setUseThreads(Boolean useThreads) {
this.useThreads = useThreads;
}
public AliasDto isVerified(Boolean isVerified) {
this.isVerified = isVerified;
return this;
}
/**
* Has the alias been verified. You must verify an alias if the masked email address has not yet been verified by your account
* @return isVerified
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "Has the alias been verified. You must verify an alias if the masked email address has not yet been verified by your account")
public Boolean getIsVerified() {
return isVerified;
}
public void setIsVerified(Boolean isVerified) {
this.isVerified = isVerified;
}
public AliasDto createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public AliasDto updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
* @return updatedAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AliasDto aliasDto = (AliasDto) o;
return Objects.equals(this.id, aliasDto.id) &&
Objects.equals(this.emailAddress, aliasDto.emailAddress) &&
Objects.equals(this.maskedEmailAddress, aliasDto.maskedEmailAddress) &&
Objects.equals(this.userId, aliasDto.userId) &&
Objects.equals(this.inboxId, aliasDto.inboxId) &&
Objects.equals(this.name, aliasDto.name) &&
Objects.equals(this.useThreads, aliasDto.useThreads) &&
Objects.equals(this.isVerified, aliasDto.isVerified) &&
Objects.equals(this.createdAt, aliasDto.createdAt) &&
Objects.equals(this.updatedAt, aliasDto.updatedAt);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, emailAddress, maskedEmailAddress, userId, inboxId, name, useThreads, isVerified, createdAt, updatedAt);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AliasDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" maskedEmailAddress: ").append(toIndentedString(maskedEmailAddress)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" inboxId: ").append(toIndentedString(inboxId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" useThreads: ").append(toIndentedString(useThreads)).append("\n");
sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("emailAddress");
openapiFields.add("maskedEmailAddress");
openapiFields.add("userId");
openapiFields.add("inboxId");
openapiFields.add("name");
openapiFields.add("useThreads");
openapiFields.add("isVerified");
openapiFields.add("createdAt");
openapiFields.add("updatedAt");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("emailAddress");
openapiRequiredFields.add("userId");
openapiRequiredFields.add("inboxId");
openapiRequiredFields.add("isVerified");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to AliasDto
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!AliasDto.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AliasDto is not found in the empty JSON string", AliasDto.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AliasDto.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AliasDto` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AliasDto.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if (!jsonObj.get("emailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString()));
}
if ((jsonObj.get("maskedEmailAddress") != null && !jsonObj.get("maskedEmailAddress").isJsonNull()) && !jsonObj.get("maskedEmailAddress").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `maskedEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskedEmailAddress").toString()));
}
if (!jsonObj.get("userId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").toString()));
}
if (!jsonObj.get("inboxId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `inboxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inboxId").toString()));
}
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AliasDto.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AliasDto' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AliasDto> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AliasDto.class));
return (TypeAdapter<T>) new TypeAdapter<AliasDto>() {
@Override
public void write(JsonWriter out, AliasDto value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AliasDto read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of AliasDto given an JSON string
*
* @param jsonString JSON string
* @return An instance of AliasDto
* @throws IOException if the JSON string is invalid with respect to AliasDto
*/
public static AliasDto fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AliasDto.class);
}
/**
* Convert an instance of AliasDto to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.mailslurp.clients.JSON;
/**
* Abstract webhook payload. Use the correct payload type for your webhook event type in order to access all the specific properties for that event. See the `NEW_EMAIL`,`NEW_CONTACT`, `NEW_ATTACHMENT` and `EMAIL_OPENED` payloads for the properties available for those events.
*/
@ApiModel(description = "Abstract webhook payload. Use the correct payload type for your webhook event type in order to access all the specific properties for that event. See the `NEW_EMAIL`,`NEW_CONTACT`, `NEW_ATTACHMENT` and `EMAIL_OPENED` payloads for the properties available for those events.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class AbstractWebhookPayload {
/**
* Gets or Sets eventName
*/
@JsonAdapter(EventNameEnum.Adapter.class)
public enum EventNameEnum {
EMAIL_RECEIVED("EMAIL_RECEIVED"),
NEW_EMAIL("NEW_EMAIL"),
NEW_CONTACT("NEW_CONTACT"),
NEW_ATTACHMENT("NEW_ATTACHMENT"),
EMAIL_OPENED("EMAIL_OPENED"),
EMAIL_READ("EMAIL_READ"),
DELIVERY_STATUS("DELIVERY_STATUS"),
BOUNCE("BOUNCE"),
BOUNCE_RECIPIENT("BOUNCE_RECIPIENT"),
NEW_SMS("NEW_SMS");
private String value;
EventNameEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static EventNameEnum fromValue(String value) {
for (EventNameEnum b : EventNameEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<EventNameEnum> {
@Override
public void write(final JsonWriter jsonWriter, final EventNameEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public EventNameEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return EventNameEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_EVENT_NAME = "eventName";
@SerializedName(SERIALIZED_NAME_EVENT_NAME)
private EventNameEnum eventName;
public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId";
@SerializedName(SERIALIZED_NAME_MESSAGE_ID)
private String messageId;
public static final String SERIALIZED_NAME_WEBHOOK_ID = "webhookId";
@SerializedName(SERIALIZED_NAME_WEBHOOK_ID)
private UUID webhookId;
public static final String SERIALIZED_NAME_WEBHOOK_NAME = "webhookName";
@SerializedName(SERIALIZED_NAME_WEBHOOK_NAME)
private String webhookName;
public AbstractWebhookPayload() {
}
public AbstractWebhookPayload eventName(EventNameEnum eventName) {
this.eventName = eventName;
return this;
}
/**
* Get eventName
* @return eventName
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public EventNameEnum getEventName() {
return eventName;
}
public void setEventName(EventNameEnum eventName) {
this.eventName = eventName;
}
public AbstractWebhookPayload messageId(String messageId) {
this.messageId = messageId;
return this;
}
/**
* Get messageId
* @return messageId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public AbstractWebhookPayload webhookId(UUID webhookId) {
this.webhookId = webhookId;
return this;
}
/**
* Get webhookId
* @return webhookId
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
public UUID getWebhookId() {
return webhookId;
}
public void setWebhookId(UUID webhookId) {
this.webhookId = webhookId;
}
public AbstractWebhookPayload webhookName(String webhookName) {
this.webhookName = webhookName;
return this;
}
/**
* Get webhookName
* @return webhookName
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getWebhookName() {
return webhookName;
}
public void setWebhookName(String webhookName) {
this.webhookName = webhookName;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AbstractWebhookPayload abstractWebhookPayload = (AbstractWebhookPayload) o;
return Objects.equals(this.eventName, abstractWebhookPayload.eventName) &&
Objects.equals(this.messageId, abstractWebhookPayload.messageId) &&
Objects.equals(this.webhookId, abstractWebhookPayload.webhookId) &&
Objects.equals(this.webhookName, abstractWebhookPayload.webhookName);
}
@Override
public int hashCode() {
return Objects.hash(eventName, messageId, webhookId, webhookName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AbstractWebhookPayload {\n");
sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n");
sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
sb.append(" webhookId: ").append(toIndentedString(webhookId)).append("\n");
sb.append(" webhookName: ").append(toIndentedString(webhookName)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("eventName");
openapiFields.add("messageId");
openapiFields.add("webhookId");
openapiFields.add("webhookName");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("eventName");
openapiRequiredFields.add("messageId");
openapiRequiredFields.add("webhookId");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to AbstractWebhookPayload
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!AbstractWebhookPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AbstractWebhookPayload is not found in the empty JSON string", AbstractWebhookPayload.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AbstractWebhookPayload.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AbstractWebhookPayload` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AbstractWebhookPayload.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
if (!jsonObj.get("eventName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `eventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventName").toString()));
}
if (!jsonObj.get("messageId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `messageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageId").toString()));
}
if (!jsonObj.get("webhookId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookId").toString()));
}
if ((jsonObj.get("webhookName") != null && !jsonObj.get("webhookName").isJsonNull()) && !jsonObj.get("webhookName").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `webhookName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookName").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AbstractWebhookPayload.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AbstractWebhookPayload' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AbstractWebhookPayload> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AbstractWebhookPayload.class));
return (TypeAdapter<T>) new TypeAdapter<AbstractWebhookPayload>() {
@Override
public void write(JsonWriter out, AbstractWebhookPayload value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AbstractWebhookPayload read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of AbstractWebhookPayload given an JSON string
*
* @param jsonString JSON string
* @return An instance of AbstractWebhookPayload
* @throws IOException if the JSON string is invalid with respect to AbstractWebhookPayload
*/
public static AbstractWebhookPayload fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AbstractWebhookPayload.class);
}
/**
* Convert an instance of AbstractWebhookPayload to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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 com.mailslurp.clients.ApiException;
import java.util.Objects;
import java.lang.reflect.Type;
import java.util.Map;
import javax.ws.rs.core.GenericType;
//import com.fasterxml.jackson.annotation.JsonValue;
/**
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public abstract class AbstractOpenApiSchema {
// store the actual instance of the schema/object
private Object instance;
// is nullable
private Boolean isNullable;
// schema type (e.g. oneOf, anyOf)
private final String schemaType;
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
this.schemaType = schemaType;
this.isNullable = isNullable;
}
/**
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
*
* @return an instance of the actual schema/object
*/
public abstract Map<String, GenericType> getSchemas();
/**
* Get the actual instance
*
* @return an instance of the actual schema/object
*/
//@JsonValue
public Object getActualInstance() {return instance;}
/**
* Set the actual instance
*
* @param instance the actual instance of the schema/object
*/
public void setActualInstance(Object instance) {this.instance = instance;}
/**
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
*
* @return an instance of the actual schema/object
*/
public Object getActualInstanceRecursively() {
return getActualInstanceRecursively(this);
}
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
if (object.getActualInstance() == null) {
return null;
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
} else {
return object.getActualInstance();
}
}
/**
* Get the schema type (e.g. anyOf, oneOf)
*
* @return the schema type
*/
public String getSchemaType() {
return schemaType;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ").append(getClass()).append(" {\n");
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 ");
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
return Objects.equals(this.instance, a.instance) &&
Objects.equals(this.isNullable, a.isNullable) &&
Objects.equals(this.schemaType, a.schemaType);
}
@Override
public int hashCode() {
return Objects.hash(instance, isNullable, schemaType);
}
/**
* Is nullable
*
* @return true if it's nullable
*/
public Boolean isNullable() {
if (Boolean.TRUE.equals(isNullable)) {
return Boolean.TRUE;
} else {
return Boolean.FALSE;
}
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) {
return true;
}
if (value != null && value.equalsIgnoreCase(str)) {
return true;
}
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) {
return "";
}
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
/**
* Join a list of strings with the given separator.
*
* @param list The list of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(Collection<String> list, String separator) {
Iterator<String> iterator = list.iterator();
StringBuilder out = new StringBuilder();
if (iterator.hasNext()) {
out.append(iterator.next());
}
while (iterator.hasNext()) {
out.append(separator).append(iterator.next());
}
return out.toString();
}
}
package com.mailslurp.clients;
import java.util.HashSet;
/**
* Representing a Server Variable for server URL template substitution.
*/
public class ServerVariable {
public String description;
public String defaultValue;
public HashSet<String> enumValues = null;
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
this.description = description;
this.defaultValue = defaultValue;
this.enumValues = enumValues;
}
}
package com.mailslurp.clients;
import java.util.Map;
/**
* Representing a Server configuration.
*/
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A description of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replace("{" + name + "}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
private final ResponseBody responseBody;
private final ApiCallback callback;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
this.responseBody = responseBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return responseBody.contentType();
}
@Override
public long contentLength() {
return responseBody.contentLength();
}
@Override
public BufferedSource source() {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
return bufferedSource;
}
private Source source(Source source) {
return new ForwardingSource(source) {
long totalBytesRead = 0L;
@Override
public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
private final RequestBody requestBody;
private final ApiCallback callback;
public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
this.requestBody = requestBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() throws IOException {
return requestBody.contentLength();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink bufferedSink = Okio.buffer(sink(sink));
requestBody.writeTo(bufferedSink);
bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source, byteCount);
if (contentLength == 0) {
contentLength = contentLength();
}
bytesWritten += byteCount;
callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Pair {
private String name = "";
private String value = "";
public Pair (String name, String value) {
setName(name);
setValue(value);
}
private void setName(String name) {
if (!isValidString(name)) {
return;
}
this.name = name;
}
private void setValue(String value) {
if (!isValidString(value)) {
return;
}
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private boolean isValidString(String arg) {
if (arg == null) {
return false;
}
return true;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import okio.ByteString;
import java.io.IOException;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
/*
* A JSON utility class
*
* NOTE: in the future, this class may be converted to static, which may break
* backward-compatibility
*/
public class JSON {
private static Gson gson;
private static boolean isLenientOnJson = false;
private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
@SuppressWarnings("unchecked")
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
}
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
}
/**
* Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
*
* @param classByDiscriminatorValue The map of discriminator values to Java classes.
* @param discriminatorValue The value of the OpenAPI discriminator in the input data.
* @return The Java class that implements the OpenAPI schema
*/
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
}
{
GsonBuilder gsonBuilder = createGson();
gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter);
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.AbstractWebhookPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.AliasDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.AliasProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.AttachmentEntity.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.AttachmentMetaData.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.AttachmentProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.BasicAuthOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.BounceProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.BounceRecipientProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.BouncedEmailDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.BouncedRecipientDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.BulkSendEmailOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.Complaint.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConditionOption.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncEventDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncEventProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncRequestResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncRequestResultException.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncRequestResultExceptionCause.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncRequestResultExceptionCauseStackTraceInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncRequestResultExceptionCauseSuppressedInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ConnectorSyncResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ContactDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ContactProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ContentMatchOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CountDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateAliasOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateConnectorImapOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateConnectorOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateContactOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateDomainOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateEmergencyAddressOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateGroupOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateInboxDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateInboxForwarderOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateInboxReplierOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateInboxRulesetOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateTemplateOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateTrackingPixelOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.CreateWebhookOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DNSLookupOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DNSLookupResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DNSLookupResults.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DeliveryStatusDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DescribeDomainOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DescribeMailServerDomainResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DomainDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DomainIssuesDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DomainNameRecord.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DomainPreview.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.DownloadAttachmentDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.Email.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailAnalysis.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailContentMatchResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailHtmlDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailLinksResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailPreview.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailPreviewUrls.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailRecipients.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailTextLinesResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailValidationRequestDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmailVerificationResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmergencyAddress.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmergencyAddressDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.EmptyResponseDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ExpirationDefaults.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ExpiredInboxDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ExpiredInboxRecordProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ExportLink.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ExportOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.FilterBouncedRecipientsOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.FilterBouncedRecipientsResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.FlushExpiredInboxesResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ForwardEmailOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.GravatarUrl.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.GroupContactsDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.GroupDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.GroupProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.HTMLValidationResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.IPAddressResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ImapFlagOperationOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ImapSmtpAccessDetails.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxByEmailAddressResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxByNameResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxExistsDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxForwarderDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxForwarderEventProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxForwarderTestOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxForwarderTestResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxIdItem.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxIdsResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxPreview.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxReplierDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxReplierEventProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxRulesetDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxRulesetTestOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.InboxRulesetTestResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.JSONSchemaDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ListUnsubscribeRecipientProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.MatchOption.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.MatchOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.MissedEmailDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.MissedEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.NameServerRecord.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.OrganizationInboxProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageAlias.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageAttachmentEntity.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageBouncedEmail.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageBouncedRecipients.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageComplaint.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageConnector.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageConnectorSyncEvents.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageContactProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageDeliveryStatus.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageEmailPreview.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageEmailValidationRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageExpiredInboxRecordProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageGroupProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageInboxForwarderDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageInboxForwarderEvents.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageInboxProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageInboxReplierDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageInboxReplierEvents.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageInboxRulesetDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageListUnsubscribeRecipients.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageMissedEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageOrganizationInboxProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PagePhoneNumberProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageScheduledJobs.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageSentEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageSentEmailWithQueueProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageSmsProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageTemplateProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageThreadProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageTrackingPixelProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageUnknownMissedEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageWebhookProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageWebhookResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PageableObject.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PhoneNumberDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PhoneNumberProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.PhonePlanDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.RawEmailJson.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.Recipient.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ReplyToAliasEmailOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ReplyToEmailOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ScheduledJob.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ScheduledJobDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SendEmailOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SendSMTPEnvelopeOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SendWithQueueResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.Sender.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SentEmailDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SentEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SetInboxFavouritedOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SimpleSendEmailOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SmsDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SmsMatchOption.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SmsPreview.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.SmsProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.Sort.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TemplateDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TemplatePreview.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TemplateProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TemplateVariable.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TestNewInboxForwarderOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TestNewInboxRulesetOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TestPhoneNumberOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ThreadProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TrackingPixelDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.TrackingPixelProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UnknownMissedEmailProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UnreadCount.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UnseenErrorCountDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UpdateAliasOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UpdateDomainOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UpdateGroupContacts.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UpdateInboxOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UpdateInboxReplierOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UploadAttachmentBytesRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UploadAttachmentOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UploadMultipartFormRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.UserInfoDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ValidateEmailAddressListOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ValidateEmailAddressListResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ValidationDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.ValidationMessage.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.VerifyEmailAddressOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.VerifyWebhookSignatureOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.VerifyWebhookSignatureResults.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WaitForConditions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WaitForSingleSmsOptions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WaitForSmsConditions.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookBouncePayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookBounceRecipientPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookDeliveryStatusPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookEmailOpenedPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookEmailReadPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookHeaderNameValue.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookHeaders.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookNewAttachmentPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookNewContactPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookNewEmailPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookNewSmsPayload.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookProjection.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookRedriveResult.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookResultDto.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookTestRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookTestResponse.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.mailslurp.models.WebhookTestResult.CustomTypeAdapterFactory());
gson = gsonBuilder.create();
}
/**
* Get Gson.
*
* @return Gson
*/
public static Gson getGson() {
return gson;
}
/**
* Set Gson.
*
* @param gson Gson
*/
public static void setGson(Gson gson) {
JSON.gson = gson;
}
public static void setLenientOnJson(boolean lenientOnJson) {
isLenientOnJson = lenientOnJson;
}
/**
* Serialize the given Java object into JSON string.
*
* @param obj Object
* @return String representation of the JSON
*/
public static String serialize(Object obj) {
return gson.toJson(obj);
}
/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(String body, Type returnType) {
try {
if (isLenientOnJson) {
JsonReader jsonReader = new JsonReader(new StringReader(body));
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(body, returnType);
}
} catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
if (returnType.equals(String.class)) {
return (T) body;
} else {
throw (e);
}
}
}
/**
* Gson TypeAdapter for Byte Array type
*/
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
}
/**
* Gson TypeAdapter for JSR310 OffsetDateTime type
*/
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
private DateTimeFormatter formatter;
public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, OffsetDateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public OffsetDateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z";
}
return OffsetDateTime.parse(date, formatter);
}
}
}
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
}
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
}
/**
* Gson TypeAdapter for java.sql.Date type
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
* (more efficient than SimpleDateFormat).
*/
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
private DateFormat dateFormat;
public SqlDateTypeAdapter() {}
public SqlDateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, java.sql.Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = date.toString();
}
out.value(value);
}
}
@Override
public java.sql.Date read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return new java.sql.Date(dateFormat.parse(date).getTime());
}
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
}
}
/**
* Gson TypeAdapter for java.util.Date type
* If the dateFormat is null, ISO8601Utils will be used.
*/
public static class DateTypeAdapter extends TypeAdapter<Date> {
private DateFormat dateFormat;
public DateTypeAdapter() {}
public DateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = ISO8601Utils.format(date, true);
}
out.value(value);
}
}
@Override
public Date read(JsonReader in) throws IOException {
try {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return dateFormat.parse(date);
}
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
} catch (IllegalArgumentException e) {
throw new JsonParseException(e);
}
}
}
public static void setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
}
public static void setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSink;
import okio.GzipSink;
import okio.Okio;
import java.io.IOException;
/**
* Encodes request bodies using gzip.
*
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
}
Request compressedRequest = originalRequest.newBuilder()
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
return chain.proceed(compressedRequest);
}
private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return new RequestBody() {
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() {
return buffer.size();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
sink.write(buffer.snapshot());
}
};
}
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
@Override
public MediaType contentType() {
return body.contentType();
}
@Override
public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
}
};
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class Configuration {
private static ApiClient defaultApiClient = new ApiClient();
/**
* Get the default API client, which would be used when creating API
* instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
return defaultApiClient;
}
/**
* Set the default API client, which would be used when creating API
* instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient = apiClient;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import java.util.List;
import java.util.Map;
/**
* API response returned by API call.
*/
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
/**
* <p>Get the <code>status code</code>.</p>
*
* @return the status code
*/
public int getStatusCode() {
return statusCode;
}
/**
* <p>Get the <code>headers</code>.</p>
*
* @return a {@link java.util.Map} of headers
*/
public Map<String, List<String>> getHeaders() {
return headers;
}
/**
* <p>Get the <code>data</code>.</p>
*
* @return the data
*/
public T getData() {
return data;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import java.util.Map;
import java.util.List;
import javax.ws.rs.core.GenericType;
/**
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
private String responseBody = null;
/**
* <p>Constructor for ApiException.</p>
*/
public ApiException() {}
/**
* <p>Constructor for ApiException.</p>
*
* @param throwable a {@link java.lang.Throwable} object
*/
public ApiException(Throwable throwable) {
super(throwable);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
*/
public ApiException(String message) {
super(message);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message a {@link java.lang.String} object
*/
public ApiException(int code, String message) {
super(message);
this.code = code;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message the error message
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* Get the HTTP status code.
*
* @return HTTP status code
*/
public int getCode() {
return code;
}
/**
* Get the HTTP response headers.
*
* @return A map of list of string
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
}
/**
* Get the HTTP response body.
*
* @return Response body in the form of string
*/
public String getResponseBody() {
return responseBody;
}
/**
* Get the exception message including HTTP response data.
*
* @return The exception message
*/
public String getMessage() {
return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import okhttp3.*;
import okhttp3.internal.http.HttpMethod;
import okhttp3.internal.tls.OkHostnameVerifier;
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import okio.Buffer;
import okio.BufferedSink;
import okio.Okio;
import javax.net.ssl.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.DateFormat;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.mailslurp.clients.auth.Authentication;
import com.mailslurp.clients.auth.HttpBasicAuth;
import com.mailslurp.clients.auth.HttpBearerAuth;
import com.mailslurp.clients.auth.ApiKeyAuth;
/**
* <p>ApiClient class.</p>
*/
public class ApiClient {
private String basePath = "https://java.api.mailslurp.com";
private boolean debugging = false;
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
private String tempFolderPath = null;
private Map<String, Authentication> authentications;
private DateFormat dateFormat;
private DateFormat datetimeFormat;
private boolean lenientDatetimeFormat;
private int dateLength;
private InputStream sslCaCert;
private boolean verifyingSsl;
private KeyManager[] keyManagers;
private OkHttpClient httpClient;
private JSON json;
private HttpLoggingInterceptor loggingInterceptor;
/**
* Basic constructor for ApiClient
*/
public ApiClient() {
init();
initHttpClient();
// Setup authentications (key: authentication name, value: authentication).
authentications.put("API_KEY", new ApiKeyAuth("header", "x-api-key"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
/**
* Basic constructor with custom OkHttpClient
*
* @param client a {@link okhttp3.OkHttpClient} object
*/
public ApiClient(OkHttpClient client) {
init();
httpClient = client;
// Setup authentications (key: authentication name, value: authentication).
authentications.put("API_KEY", new ApiKeyAuth("header", "x-api-key"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
private void initHttpClient() {
initHttpClient(Collections.<Interceptor>emptyList());
}
private void initHttpClient(List<Interceptor> interceptors) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.addNetworkInterceptor(getProgressInterceptor());
for (Interceptor interceptor: interceptors) {
builder.addInterceptor(interceptor);
}
httpClient = builder.build();
}
private void init() {
verifyingSsl = true;
json = new JSON();
// Set default User-Agent.
setUserAgent("OpenAPI-Generator/15.17.17/java");
authentications = new HashMap<String, Authentication>();
}
/**
* Get base path
*
* @return Base path
*/
public String getBasePath() {
return basePath;
}
/**
* Set base path
*
* @param basePath Base path of the URL (e.g https://java.api.mailslurp.com
* @return An instance of OkHttpClient
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
return this;
}
/**
* Get HTTP client
*
* @return An instance of OkHttpClient
*/
public OkHttpClient getHttpClient() {
return httpClient;
}
/**
* Set HTTP client, which must never be null.
*
* @param newHttpClient An instance of OkHttpClient
* @return Api Client
* @throws java.lang.NullPointerException when newHttpClient is null
*/
public ApiClient setHttpClient(OkHttpClient newHttpClient) {
this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!");
return this;
}
/**
* Get JSON
*
* @return JSON object
*/
public JSON getJSON() {
return json;
}
/**
* Set JSON
*
* @param json JSON object
* @return Api client
*/
public ApiClient setJSON(JSON json) {
this.json = json;
return this;
}
/**
* True if isVerifyingSsl flag is on
*
* @return True if isVerifySsl flag is on
*/
public boolean isVerifyingSsl() {
return verifyingSsl;
}
/**
* Configure whether to verify certificate and hostname when making https requests.
* Default to true.
* NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks.
*
* @param verifyingSsl True to verify TLS/SSL connection
* @return ApiClient
*/
public ApiClient setVerifyingSsl(boolean verifyingSsl) {
this.verifyingSsl = verifyingSsl;
applySslSettings();
return this;
}
/**
* Get SSL CA cert.
*
* @return Input stream to the SSL CA cert
*/
public InputStream getSslCaCert() {
return sslCaCert;
}
/**
* Configure the CA certificate to be trusted when making https requests.
* Use null to reset to default.
*
* @param sslCaCert input stream for SSL CA cert
* @return ApiClient
*/
public ApiClient setSslCaCert(InputStream sslCaCert) {
this.sslCaCert = sslCaCert;
applySslSettings();
return this;
}
/**
* <p>Getter for the field <code>keyManagers</code>.</p>
*
* @return an array of {@link javax.net.ssl.KeyManager} objects
*/
public KeyManager[] getKeyManagers() {
return keyManagers;
}
/**
* Configure client keys to use for authorization in an SSL session.
* Use null to reset to default.
*
* @param managers The KeyManagers to use
* @return ApiClient
*/
public ApiClient setKeyManagers(KeyManager[] managers) {
this.keyManagers = managers;
applySslSettings();
return this;
}
/**
* <p>Getter for the field <code>dateFormat</code>.</p>
*
* @return a {@link java.text.DateFormat} object
*/
public DateFormat getDateFormat() {
return dateFormat;
}
/**
* <p>Setter for the field <code>dateFormat</code>.</p>
*
* @param dateFormat a {@link java.text.DateFormat} object
* @return a {@link com.mailslurp.clients.ApiClient} object
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
JSON.setDateFormat(dateFormat);
return this;
}
/**
* <p>Set SqlDateFormat.</p>
*
* @param dateFormat a {@link java.text.DateFormat} object
* @return a {@link com.mailslurp.clients.ApiClient} object
*/
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
JSON.setSqlDateFormat(dateFormat);
return this;
}
/**
* <p>Set OffsetDateTimeFormat.</p>
*
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
* @return a {@link com.mailslurp.clients.ApiClient} object
*/
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
JSON.setOffsetDateTimeFormat(dateFormat);
return this;
}
/**
* <p>Set LocalDateFormat.</p>
*
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
* @return a {@link com.mailslurp.clients.ApiClient} object
*/
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
JSON.setLocalDateFormat(dateFormat);
return this;
}
/**
* <p>Set LenientOnJson.</p>
*
* @param lenientOnJson a boolean
* @return a {@link com.mailslurp.clients.ApiClient} object
*/
public ApiClient setLenientOnJson(boolean lenientOnJson) {
JSON.setLenientOnJson(lenientOnJson);
return this;
}
/**
* Get authentications (key: authentication name, value: authentication).
*
* @return Map of authentication objects
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
}
/**
* Get authentication for the given name.
*
* @param authName The authentication name
* @return The authentication, null if not found
*/
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
/**
* Helper method to set username for the first HTTP basic authentication.
*
* @param username Username
*/
public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setUsername(username);
return;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
/**
* Helper method to set password for the first HTTP basic authentication.
*
* @param password Password
*/
public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
/**
* Helper method to set API key value for the first API key authentication.
*
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set API key prefix for the first API key authentication.
*
* @param apiKeyPrefix API key prefix
*/
public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set access token for the first OAuth2 authentication.
*
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
throw new RuntimeException("No OAuth2 authentication configured!");
}
/**
* Set the User-Agent header's value (by adding to the default header map).
*
* @param userAgent HTTP request's user agent
* @return ApiClient
*/
public ApiClient setUserAgent(String userAgent) {
addDefaultHeader("User-Agent", userAgent);
return this;
}
/**
* Add a default header.
*
* @param key The header's key
* @param value The header's value
* @return ApiClient
*/
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
return this;
}
/**
* Add a default cookie.
*
* @param key The cookie's key
* @param value The cookie's value
* @return ApiClient
*/
public ApiClient addDefaultCookie(String key, String value) {
defaultCookieMap.put(key, value);
return this;
}
/**
* Check that whether debugging is enabled for this API client.
*
* @return True if debugging is enabled, false otherwise.
*/
public boolean isDebugging() {
return debugging;
}
/**
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return ApiClient
*/
public ApiClient setDebugging(boolean debugging) {
if (debugging != this.debugging) {
if (debugging) {
loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(Level.BODY);
httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
} else {
final OkHttpClient.Builder builder = httpClient.newBuilder();
builder.interceptors().remove(loggingInterceptor);
httpClient = builder.build();
loggingInterceptor = null;
}
}
this.debugging = debugging;
return this;
}
/**
* The path of temporary folder used to store downloaded files from endpoints
* with file response. The default value is <code>null</code>, i.e. using
* the system's default temporary folder.
*
* @see <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempFile(java.lang.String,%20java.lang.String,%20java.nio.file.attribute.FileAttribute...)">createTempFile</a>
* @return Temporary folder path
*/
public String getTempFolderPath() {
return tempFolderPath;
}
/**
* Set the temporary folder path (for downloading files)
*
* @param tempFolderPath Temporary folder path
* @return ApiClient
*/
public ApiClient setTempFolderPath(String tempFolderPath) {
this.tempFolderPath = tempFolderPath;
return this;
}
/**
* Get connection timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getConnectTimeout() {
return httpClient.connectTimeoutMillis();
}
/**
* Sets the connect timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link java.lang.Integer#MAX_VALUE}.
*
* @param connectionTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Get read timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getReadTimeout() {
return httpClient.readTimeoutMillis();
}
/**
* Sets the read timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link java.lang.Integer#MAX_VALUE}.
*
* @param readTimeout read timeout in milliseconds
* @return Api client
*/
public ApiClient setReadTimeout(int readTimeout) {
httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Get write timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getWriteTimeout() {
return httpClient.writeTimeoutMillis();
}
/**
* Sets the write timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link java.lang.Integer#MAX_VALUE}.
*
* @param writeTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setWriteTimeout(int writeTimeout) {
httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Format the given parameter object into string.
*
* @param param Parameter
* @return String representation of the parameter
*/
public String parameterToString(Object param) {
if (param == null) {
return "";
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
//Serialize to json string and remove the " enclosing characters
String jsonStr = JSON.serialize(param);
return jsonStr.substring(1, jsonStr.length() - 1);
} else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for (Object o : (Collection) param) {
if (b.length() > 0) {
b.append(",");
}
b.append(o);
}
return b.toString();
} else {
return String.valueOf(param);
}
}
/**
* Formats the specified query parameter to a list containing a single {@code Pair} object.
*
* Note that {@code value} must not be a collection.
*
* @param name The name of the parameter.
* @param value The value of the parameter.
* @return A list containing a single {@code Pair} object.
*/
public List<Pair> parameterToPair(String name, Object value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
return params;
}
params.add(new Pair(name, parameterToString(value)));
return params;
}
/**
* Formats the specified collection query parameters to a list of {@code Pair} objects.
*
* Note that the values of each of the returned Pair objects are percent-encoded.
*
* @param collectionFormat The collection format of the parameter.
* @param name The name of the parameter.
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}
// create the params based on the collection format
if ("multi".equals(collectionFormat)) {
for (Object item : value) {
params.add(new Pair(name, escapeString(parameterToString(item))));
}
return params;
}
// collectionFormat is assumed to be "csv" by default
String delimiter = ",";
// escape all delimiters except commas, which are URI reserved
// characters
if ("ssv".equals(collectionFormat)) {
delimiter = escapeString(" ");
} else if ("tsv".equals(collectionFormat)) {
delimiter = escapeString("\t");
} else if ("pipes".equals(collectionFormat)) {
delimiter = escapeString("|");
}
StringBuilder sb = new StringBuilder();
for (Object item : value) {
sb.append(delimiter);
sb.append(escapeString(parameterToString(item)));
}
params.add(new Pair(name, sb.substring(delimiter.length())));
return params;
}
/**
* Formats the specified collection path parameter to a string value.
*
* @param collectionFormat The collection format of the parameter.
* @param value The value of the parameter.
* @return String representation of the parameter
*/
public String collectionPathParameterToString(String collectionFormat, Collection value) {
// create the value based on the collection format
if ("multi".equals(collectionFormat)) {
// not valid for path params
return parameterToString(value);
}
// collectionFormat is assumed to be "csv" by default
String delimiter = ",";
if ("ssv".equals(collectionFormat)) {
delimiter = " ";
} else if ("tsv".equals(collectionFormat)) {
delimiter = "\t";
} else if ("pipes".equals(collectionFormat)) {
delimiter = "|";
}
StringBuilder sb = new StringBuilder() ;
for (Object item : value) {
sb.append(delimiter);
sb.append(parameterToString(item));
}
return sb.substring(delimiter.length());
}
/**
* Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif
*
* @param filename The filename to be sanitized
* @return The sanitized filename
*/
public String sanitizeFilename(String filename) {
return filename.replaceAll(".*[/\\\\]", "");
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* "* / *" is also default to JSON
* @param mime MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**
* Select the Accept header's value from the given accepts array:
* if JSON exists in the given array, use it;
* otherwise use all of them (joining into a string)
*
* @param accepts The accepts array to select from
* @return The Accept header to use. If the given array is empty,
* null will be returned (not to set the Accept header explicitly).
*/
public String selectHeaderAccept(String[] accepts) {
if (accepts.length == 0) {
return null;
}
for (String accept : accepts) {
if (isJsonMime(accept)) {
return accept;
}
}
return StringUtil.join(accepts, ",");
}
/**
* Select the Content-Type header's value from the given array:
* if JSON exists in the given array, use it;
* otherwise use the first one of the array.
*
* @param contentTypes The Content-Type array to select from
* @return The Content-Type header to use. If the given array is empty,
* returns null. If it matches "any", JSON will be used.
*/
public String selectHeaderContentType(String[] contentTypes) {
if (contentTypes.length == 0) {
return null;
}
if (contentTypes[0].equals("*/*")) {
return "application/json";
}
for (String contentType : contentTypes) {
if (isJsonMime(contentType)) {
return contentType;
}
}
return contentTypes[0];
}
/**
* Escape the given string to be used as URL query value.
*
* @param str String to be escaped
* @return Escaped string
*/
public String escapeString(String str) {
try {
return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
} catch (UnsupportedEncodingException e) {
return str;
}
}
/**
* Deserialize response body to Java object, according to the return type and
* the Content-Type response header.
*
* @param <T> Type
* @param response HTTP response
* @param returnType The type of the Java object
* @return The deserialized Java object
* @throws com.mailslurp.clients.ApiException If fail to deserialize response body, i.e. cannot read response body
* or the Content-Type of the response is not supported.
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
if ("byte[]".equals(returnType.toString())) {
// Handle binary response (byte array).
try {
return (T) response.body().bytes();
} catch (IOException e) {
throw new ApiException(e);
}
} else if (returnType.equals(File.class)) {
// Handle file downloading.
return (T) downloadFileFromResponse(response);
}
String respBody;
try {
if (response.body() != null)
respBody = response.body().string();
else
respBody = null;
} catch (IOException e) {
throw new ApiException(e);
}
if (respBody == null || "".equals(respBody)) {
return null;
}
String contentType = response.headers().get("Content-Type");
if (contentType == null) {
// ensuring a default content type
contentType = "application/json";
}
if (isJsonMime(contentType)) {
return JSON.deserialize(respBody, returnType);
} else if (returnType.equals(String.class)) {
// Expecting string, return the raw response body.
return (T) respBody;
} else {
throw new ApiException(
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
response.code(),
response.headers().toMultimap(),
respBody);
}
}
/**
* Serialize the given Java object into request body according to the object's
* class and the request Content-Type.
*
* @param obj The Java object
* @param contentType The request Content-Type
* @return The serialized request body
* @throws com.mailslurp.clients.ApiException If fail to serialize the given object
*/
public RequestBody serialize(Object obj, String contentType) throws ApiException {
if (obj instanceof byte[]) {
// Binary (byte array) body parameter support.
return RequestBody.create((byte[]) obj, MediaType.parse(contentType));
} else if (obj instanceof File) {
// File body parameter support.
return RequestBody.create((File) obj, MediaType.parse(contentType));
} else if ("text/plain".equals(contentType) && obj instanceof String) {
return RequestBody.create((String) obj, MediaType.parse(contentType));
} else if (isJsonMime(contentType)) {
String content;
if (obj != null) {
content = JSON.serialize(obj);
} else {
content = null;
}
return RequestBody.create(content, MediaType.parse(contentType));
} else if (obj instanceof String) {
return RequestBody.create((String) obj, MediaType.parse(contentType));
} else {
throw new ApiException("Content type \"" + contentType + "\" is not supported");
}
}
/**
* Download file from the given response.
*
* @param response An instance of the Response object
* @throws com.mailslurp.clients.ApiException If fail to read file content from response and write to disk
* @return Downloaded file
*/
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
BufferedSink sink = Okio.buffer(Okio.sink(file));
sink.writeAll(response.body().source());
sink.close();
return file;
} catch (IOException e) {
throw new ApiException(e);
}
}
/**
* Prepare file for download
*
* @param response An instance of the Response object
* @return Prepared file for the download
* @throws java.io.IOException If fail to prepare file for download
*/
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = response.header("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find()) {
filename = sanitizeFilename(matcher.group(1));
}
}
String prefix = null;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf(".");
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// Files.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return Files.createTempFile(prefix, suffix).toFile();
else
return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
}
/**
* {@link #execute(Call, Type)}
*
* @param <T> Type
* @param call An instance of the Call object
* @return ApiResponse<T>
* @throws com.mailslurp.clients.ApiException If fail to execute the call
*/
public <T> ApiResponse<T> execute(Call call) throws ApiException {
return execute(call, null);
}
/**
* Execute HTTP call and deserialize the HTTP response body into the given return type.
*
* @param returnType The return type used to deserialize HTTP response body
* @param <T> The return type corresponding to (same with) returnType
* @param call Call
* @return ApiResponse object containing response status, headers and
* data, which is a Java object deserialized from response body and would be null
* when returnType is null.
* @throws com.mailslurp.clients.ApiException If fail to execute the call
*/
public <T> ApiResponse<T> execute(Call call, Type returnType) throws ApiException {
try {
Response response = call.execute();
T data = handleResponse(response, returnType);
return new ApiResponse<T>(response.code(), response.headers().toMultimap(), data);
} catch (IOException e) {
throw new ApiException(e);
}
}
/**
* {@link #executeAsync(Call, Type, ApiCallback)}
*
* @param <T> Type
* @param call An instance of the Call object
* @param callback ApiCallback<T>
*/
public <T> void executeAsync(Call call, ApiCallback<T> callback) {
executeAsync(call, null, callback);
}
/**
* Execute HTTP call asynchronously.
*
* @param <T> Type
* @param call The callback to be executed when the API call finishes
* @param returnType Return type
* @param callback ApiCallback
* @see #execute(Call, Type)
*/
@SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
callback.onFailure(new ApiException(e), 0, null);
}
@Override
public void onResponse(Call call, Response response) throws IOException {
T result;
try {
result = (T) handleResponse(response, returnType);
} catch (ApiException e) {
callback.onFailure(e, response.code(), response.headers().toMultimap());
return;
} catch (Exception e) {
callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap());
return;
}
callback.onSuccess(result, response.code(), response.headers().toMultimap());
}
});
}
/**
* Handle the given response, return the deserialized object when the response is successful.
*
* @param <T> Type
* @param response Response
* @param returnType Return type
* @return Type
* @throws com.mailslurp.clients.ApiException If the response has an unsuccessful status code or
* fail to deserialize the response body
*/
public <T> T handleResponse(Response response, Type returnType) throws ApiException {
if (response.isSuccessful()) {
if (returnType == null || response.code() == 204) {
// returning null if the returnType is not defined,
// or the status code is 204 (No Content)
if (response.body() != null) {
try {
response.body().close();
} catch (Exception e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
return null;
} else {
return deserialize(response, returnType);
}
} else {
String respBody = null;
if (response.body() != null) {
try {
respBody = response.body().string();
} catch (IOException e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody);
}
}
/**
* Build HTTP call with the given options.
*
* @param baseUrl The base URL
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param callback Callback for upload/download progress
* @return The HTTP call
* @throws com.mailslurp.clients.ApiException If fail to serialize the request body object
*/
public Call buildCall(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback);
return httpClient.newCall(request);
}
/**
* Build an HTTP request with the given options.
*
* @param baseUrl The base URL
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param callback Callback for upload/download progress
* @return The HTTP request
* @throws com.mailslurp.clients.ApiException If fail to serialize the request body object
*/
public Request buildRequest(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
// aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams
List<Pair> allQueryParams = new ArrayList<Pair>(queryParams);
allQueryParams.addAll(collectionQueryParams);
final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams);
// prepare HTTP request body
RequestBody reqBody;
String contentType = headerParams.get("Content-Type");
if (!HttpMethod.permitsRequestBody(method)) {
reqBody = null;
} else if ("application/x-www-form-urlencoded".equals(contentType)) {
reqBody = buildRequestBodyFormEncoding(formParams);
} else if ("multipart/form-data".equals(contentType)) {
reqBody = buildRequestBodyMultipart(formParams);
} else if (body == null) {
if ("DELETE".equals(method)) {
// allow calling DELETE without sending a request body
reqBody = null;
} else {
// use an empty request body (for POST, PUT and PATCH)
reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType));
}
} else {
reqBody = serialize(body, contentType);
}
// update parameters with authentication settings
updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url));
final Request.Builder reqBuilder = new Request.Builder().url(url);
processHeaderParams(headerParams, reqBuilder);
processCookieParams(cookieParams, reqBuilder);
// Associate callback with request (if not null) so interceptor can
// access it when creating ProgressResponseBody
reqBuilder.tag(callback);
Request request = null;
if (callback != null && reqBody != null) {
ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback);
request = reqBuilder.method(method, progressRequestBody).build();
} else {
request = reqBuilder.method(method, reqBody).build();
}
return request;
}
/**
* Build full URL by concatenating base path, the given sub path and query parameters.
*
* @param baseUrl The base URL
* @param path The sub path
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @return The full URL
*/
public String buildUrl(String baseUrl, String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
final StringBuilder url = new StringBuilder();
if (baseUrl != null) {
url.append(baseUrl).append(path);
} else {
url.append(basePath).append(path);
}
if (queryParams != null && !queryParams.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
String prefix = path.contains("?") ? "&" : "?";
for (Pair param : queryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
prefix = null;
} else {
url.append("&");
}
String value = parameterToString(param.getValue());
url.append(escapeString(param.getName())).append("=").append(escapeString(value));
}
}
}
if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
String prefix = url.toString().contains("?") ? "&" : "?";
for (Pair param : collectionQueryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
prefix = null;
} else {
url.append("&");
}
String value = parameterToString(param.getValue());
// collection query parameter value already escaped as part of parameterToPairs
url.append(escapeString(param.getName())).append("=").append(value);
}
}
}
return url.toString();
}
/**
* Set header parameters to the request builder, including default headers.
*
* @param headerParams Header parameters in the form of Map
* @param reqBuilder Request.Builder
*/
public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : headerParams.entrySet()) {
reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
}
for (Entry<String, String> header : defaultHeaderMap.entrySet()) {
if (!headerParams.containsKey(header.getKey())) {
reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
}
}
}
/**
* Set cookie parameters to the request builder, including default cookies.
*
* @param cookieParams Cookie parameters in the form of Map
* @param reqBuilder Request.Builder
*/
public void processCookieParams(Map<String, String> cookieParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : cookieParams.entrySet()) {
reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
}
for (Entry<String, String> param : defaultCookieMap.entrySet()) {
if (!cookieParams.containsKey(param.getKey())) {
reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
}
}
}
/**
* Update query and header parameters based on authentication settings.
*
* @param authNames The authentications to apply
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
* @param payload HTTP request body
* @param method HTTP method
* @param uri URI
* @throws com.mailslurp.clients.ApiException If fails to update the parameters
*/
public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams,
Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
throw new RuntimeException("Authentication undefined: " + authName);
}
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
/**
* Build a form-encoding request body with the given form parameters.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) {
okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
for (Entry<String, Object> param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
return formBuilder.build();
}
/**
* Build a multipart (file uploading) request body with the given form parameters,
* which could contain text fields and file fields.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
for (Entry<String, Object> param : formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
addPartToMultiPartBuilder(mpBuilder, param.getKey(), file);
} else if (param.getValue() instanceof List) {
List list = (List) param.getValue();
for (Object item: list) {
if (item instanceof File) {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item);
} else {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue());
}
}
} else {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue());
}
}
return mpBuilder.build();
}
/**
* Guess Content-Type header from the given file (defaults to "application/octet-stream").
*
* @param file The given file
* @return The guessed Content-Type
*/
public String guessContentTypeFromFile(File file) {
String contentType = URLConnection.guessContentTypeFromName(file.getName());
if (contentType == null) {
return "application/octet-stream";
} else {
return contentType;
}
}
/**
* Add a Content-Disposition Header for the given key and file to the MultipartBody Builder.
*
* @param mpBuilder MultipartBody.Builder
* @param key The key of the Header element
* @param file The file to add to the Header
*/
private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) {
Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\"");
MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType));
}
/**
* Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder.
*
* @param mpBuilder MultipartBody.Builder
* @param key The key of the Header element
* @param obj The complex object to add to the Header
*/
private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) {
RequestBody requestBody;
if (obj instanceof String) {
requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain"));
} else {
String content;
if (obj != null) {
content = JSON.serialize(obj);
} else {
content = null;
}
requestBody = RequestBody.create(content, MediaType.parse("application/json"));
}
Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"");
mpBuilder.addPart(partHeaders, requestBody);
}
/**
* Get network interceptor to add it to the httpClient to track download progress for
* async requests.
*/
private Interceptor getProgressInterceptor() {
return new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
final Request request = chain.request();
final Response originalResponse = chain.proceed(request);
if (request.tag() instanceof ApiCallback) {
final ApiCallback callback = (ApiCallback) request.tag();
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), callback))
.build();
}
return originalResponse;
}
};
}
/**
* Apply SSL related settings to httpClient according to the current values of
* verifyingSsl and sslCaCert.
*/
private void applySslSettings() {
try {
TrustManager[] trustManagers;
HostnameVerifier hostnameVerifier;
if (!verifyingSsl) {
trustManagers = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}
};
hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
} else {
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
if (sslCaCert == null) {
trustManagerFactory.init((KeyStore) null);
} else {
char[] password = null; // Any password will work.
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
Collection<? extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
if (certificates.isEmpty()) {
throw new IllegalArgumentException("expected non-empty set of trusted certificates");
}
KeyStore caKeyStore = newEmptyKeyStore(password);
int index = 0;
for (Certificate certificate : certificates) {
String certificateAlias = "ca" + (index++);
caKeyStore.setCertificateEntry(certificateAlias, certificate);
}
trustManagerFactory.init(caKeyStore);
}
trustManagers = trustManagerFactory.getTrustManagers();
hostnameVerifier = OkHostnameVerifier.INSTANCE;
}
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagers, trustManagers, new SecureRandom());
httpClient = httpClient.newBuilder()
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
.hostnameVerifier(hostnameVerifier)
.build();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, password);
return keyStore;
} catch (IOException e) {
throw new AssertionError(e);
}
}
/**
* Convert the HTTP request body to a string.
*
* @param requestBody The HTTP request object
* @return The string representation of the HTTP request body
* @throws com.mailslurp.clients.ApiException If fail to serialize the request body object into a string
*/
private String requestBodyToString(RequestBody requestBody) throws ApiException {
if (requestBody != null) {
try {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return buffer.readUtf8();
} catch (final IOException e) {
throw new ApiException(e);
}
}
// empty http request body
return "";
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients;
import java.io.IOException;
import java.util.Map;
import java.util.List;
/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API download processing.
*
* @param bytesRead bytes Read
* @param contentLength content length of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients.auth;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Pair;
import java.net.URI;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class HttpBearerAuth implements Authentication {
private final String scheme;
private String bearerToken;
public HttpBearerAuth(String scheme) {
this.scheme = scheme;
}
/**
* Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @return The bearer token
*/
public String getBearerToken() {
return bearerToken;
}
/**
* Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @param bearerToken The bearer token to send in the Authorization header
*/
public void setBearerToken(String bearerToken) {
this.bearerToken = bearerToken;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (bearerToken == null) {
return;
}
headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
}
private static String upperCaseBearer(String scheme) {
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients.auth;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ApiException;
import okhttp3.Credentials;
import java.net.URI;
import java.util.Map;
import java.util.List;
import java.io.UnsupportedEncodingException;
public class HttpBasicAuth implements Authentication {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (username == null && password == null) {
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
password == null ? "" : password));
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients.auth;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ApiException;
import java.net.URI;
import java.util.Map;
import java.util.List;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
* @param payload HTTP request body
* @param method HTTP method
* @param uri URI
* @throws ApiException if failed to update the parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException;
}
/*
* 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: contact@mailslurp.dev
*
* 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.clients.auth;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Pair;
import java.net.URI;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-12T23:33:57.654989Z[Etc/UTC]")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
} else if ("cookie".equals(location)) {
cookieParams.put(paramName, value);
}
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.AbstractWebhookPayload;
import com.mailslurp.models.CreateWebhookOptions;
import com.mailslurp.models.JSONSchemaDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageWebhookProjection;
import com.mailslurp.models.PageWebhookResult;
import java.util.UUID;
import com.mailslurp.models.UnseenErrorCountDto;
import com.mailslurp.models.VerifyWebhookSignatureOptions;
import com.mailslurp.models.VerifyWebhookSignatureResults;
import com.mailslurp.models.WebhookBouncePayload;
import com.mailslurp.models.WebhookBounceRecipientPayload;
import com.mailslurp.models.WebhookDeliveryStatusPayload;
import com.mailslurp.models.WebhookDto;
import com.mailslurp.models.WebhookEmailOpenedPayload;
import com.mailslurp.models.WebhookEmailReadPayload;
import com.mailslurp.models.WebhookHeaders;
import com.mailslurp.models.WebhookNewAttachmentPayload;
import com.mailslurp.models.WebhookNewContactPayload;
import com.mailslurp.models.WebhookNewEmailPayload;
import com.mailslurp.models.WebhookNewSmsPayload;
import com.mailslurp.models.WebhookRedriveResult;
import com.mailslurp.models.WebhookResultDto;
import com.mailslurp.models.WebhookTestResult;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class WebhookControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public WebhookControllerApi() {
this(Configuration.getDefaultApiClient());
}
public WebhookControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createAccountWebhook
* @param createWebhookOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createAccountWebhookCall(CreateWebhookOptions createWebhookOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createWebhookOptions;
// create path and map variables
String localVarPath = "/webhooks";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createAccountWebhookValidateBeforeCall(CreateWebhookOptions createWebhookOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createWebhookOptions' is set
if (createWebhookOptions == null) {
throw new ApiException("Missing the required parameter 'createWebhookOptions' when calling createAccountWebhook(Async)");
}
return createAccountWebhookCall(createWebhookOptions, _callback);
}
/**
* Attach a WebHook URL to an inbox
* Get notified of account level events such as bounce and bounce recipient.
* @param createWebhookOptions (required)
* @return WebhookDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public WebhookDto createAccountWebhook(CreateWebhookOptions createWebhookOptions) throws ApiException {
ApiResponse<WebhookDto> localVarResp = createAccountWebhookWithHttpInfo(createWebhookOptions);
return localVarResp.getData();
}
/**
* Attach a WebHook URL to an inbox
* Get notified of account level events such as bounce and bounce recipient.
* @param createWebhookOptions (required)
* @return ApiResponse<WebhookDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookDto> createAccountWebhookWithHttpInfo(CreateWebhookOptions createWebhookOptions) throws ApiException {
okhttp3.Call localVarCall = createAccountWebhookValidateBeforeCall(createWebhookOptions, null);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Attach a WebHook URL to an inbox (asynchronously)
* Get notified of account level events such as bounce and bounce recipient.
* @param createWebhookOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createAccountWebhookAsync(CreateWebhookOptions createWebhookOptions, final ApiCallback<WebhookDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createAccountWebhookValidateBeforeCall(createWebhookOptions, _callback);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createWebhook
* @param inboxId (required)
* @param createWebhookOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createWebhookCall(UUID inboxId, CreateWebhookOptions createWebhookOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createWebhookOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/webhooks"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createWebhookValidateBeforeCall(UUID inboxId, CreateWebhookOptions createWebhookOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling createWebhook(Async)");
}
// verify the required parameter 'createWebhookOptions' is set
if (createWebhookOptions == null) {
throw new ApiException("Missing the required parameter 'createWebhookOptions' when calling createWebhook(Async)");
}
return createWebhookCall(inboxId, createWebhookOptions, _callback);
}
/**
* Attach a WebHook URL to an inbox
* Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.
* @param inboxId (required)
* @param createWebhookOptions (required)
* @return WebhookDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public WebhookDto createWebhook(UUID inboxId, CreateWebhookOptions createWebhookOptions) throws ApiException {
ApiResponse<WebhookDto> localVarResp = createWebhookWithHttpInfo(inboxId, createWebhookOptions);
return localVarResp.getData();
}
/**
* Attach a WebHook URL to an inbox
* Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.
* @param inboxId (required)
* @param createWebhookOptions (required)
* @return ApiResponse<WebhookDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookDto> createWebhookWithHttpInfo(UUID inboxId, CreateWebhookOptions createWebhookOptions) throws ApiException {
okhttp3.Call localVarCall = createWebhookValidateBeforeCall(inboxId, createWebhookOptions, null);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Attach a WebHook URL to an inbox (asynchronously)
* Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.
* @param inboxId (required)
* @param createWebhookOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createWebhookAsync(UUID inboxId, CreateWebhookOptions createWebhookOptions, final ApiCallback<WebhookDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createWebhookValidateBeforeCall(inboxId, createWebhookOptions, _callback);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createWebhookForPhoneNumber
* @param phoneNumberId (required)
* @param createWebhookOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createWebhookForPhoneNumberCall(UUID phoneNumberId, CreateWebhookOptions createWebhookOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createWebhookOptions;
// create path and map variables
String localVarPath = "/phone/numbers/{phoneNumberId}/webhooks"
.replace("{" + "phoneNumberId" + "}", localVarApiClient.escapeString(phoneNumberId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createWebhookForPhoneNumberValidateBeforeCall(UUID phoneNumberId, CreateWebhookOptions createWebhookOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'phoneNumberId' is set
if (phoneNumberId == null) {
throw new ApiException("Missing the required parameter 'phoneNumberId' when calling createWebhookForPhoneNumber(Async)");
}
// verify the required parameter 'createWebhookOptions' is set
if (createWebhookOptions == null) {
throw new ApiException("Missing the required parameter 'createWebhookOptions' when calling createWebhookForPhoneNumber(Async)");
}
return createWebhookForPhoneNumberCall(phoneNumberId, createWebhookOptions, _callback);
}
/**
* Attach a WebHook URL to a phone number
* Get notified whenever a phone number receives an SMS via a WebHook URL.
* @param phoneNumberId (required)
* @param createWebhookOptions (required)
* @return WebhookDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public WebhookDto createWebhookForPhoneNumber(UUID phoneNumberId, CreateWebhookOptions createWebhookOptions) throws ApiException {
ApiResponse<WebhookDto> localVarResp = createWebhookForPhoneNumberWithHttpInfo(phoneNumberId, createWebhookOptions);
return localVarResp.getData();
}
/**
* Attach a WebHook URL to a phone number
* Get notified whenever a phone number receives an SMS via a WebHook URL.
* @param phoneNumberId (required)
* @param createWebhookOptions (required)
* @return ApiResponse<WebhookDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookDto> createWebhookForPhoneNumberWithHttpInfo(UUID phoneNumberId, CreateWebhookOptions createWebhookOptions) throws ApiException {
okhttp3.Call localVarCall = createWebhookForPhoneNumberValidateBeforeCall(phoneNumberId, createWebhookOptions, null);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Attach a WebHook URL to a phone number (asynchronously)
* Get notified whenever a phone number receives an SMS via a WebHook URL.
* @param phoneNumberId (required)
* @param createWebhookOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createWebhookForPhoneNumberAsync(UUID phoneNumberId, CreateWebhookOptions createWebhookOptions, final ApiCallback<WebhookDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createWebhookForPhoneNumberValidateBeforeCall(phoneNumberId, createWebhookOptions, _callback);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteAllWebhooks
* @param before before (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllWebhooksCall(OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAllWebhooksValidateBeforeCall(OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return deleteAllWebhooksCall(before, _callback);
}
/**
* Delete all webhooks
*
* @param before before (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAllWebhooks(OffsetDateTime before) throws ApiException {
deleteAllWebhooksWithHttpInfo(before);
}
/**
* Delete all webhooks
*
* @param before before (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAllWebhooksWithHttpInfo(OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = deleteAllWebhooksValidateBeforeCall(before, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all webhooks (asynchronously)
*
* @param before before (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllWebhooksAsync(OffsetDateTime before, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAllWebhooksValidateBeforeCall(before, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteWebhook
* @param inboxId (required)
* @param webhookId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteWebhookCall(UUID inboxId, UUID webhookId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/webhooks/{webhookId}"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()))
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteWebhookValidateBeforeCall(UUID inboxId, UUID webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling deleteWebhook(Async)");
}
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling deleteWebhook(Async)");
}
return deleteWebhookCall(inboxId, webhookId, _callback);
}
/**
* Delete and disable a Webhook for an Inbox
*
* @param inboxId (required)
* @param webhookId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteWebhook(UUID inboxId, UUID webhookId) throws ApiException {
deleteWebhookWithHttpInfo(inboxId, webhookId);
}
/**
* Delete and disable a Webhook for an Inbox
*
* @param inboxId (required)
* @param webhookId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteWebhookWithHttpInfo(UUID inboxId, UUID webhookId) throws ApiException {
okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(inboxId, webhookId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete and disable a Webhook for an Inbox (asynchronously)
*
* @param inboxId (required)
* @param webhookId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteWebhookAsync(UUID inboxId, UUID webhookId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(inboxId, webhookId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteWebhookById
* @param webhookId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteWebhookByIdCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteWebhookByIdValidateBeforeCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling deleteWebhookById(Async)");
}
return deleteWebhookByIdCall(webhookId, _callback);
}
/**
* Delete a webhook
*
* @param webhookId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public void deleteWebhookById(UUID webhookId) throws ApiException {
deleteWebhookByIdWithHttpInfo(webhookId);
}
/**
* Delete a webhook
*
* @param webhookId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteWebhookByIdWithHttpInfo(UUID webhookId) throws ApiException {
okhttp3.Call localVarCall = deleteWebhookByIdValidateBeforeCall(webhookId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete a webhook (asynchronously)
*
* @param webhookId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteWebhookByIdAsync(UUID webhookId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteWebhookByIdValidateBeforeCall(webhookId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllAccountWebhooks
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param eventType Optional event type (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllAccountWebhooksCall(Integer page, Integer size, String sort, String eventType, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/account/paginated";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (eventType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("eventType", eventType));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllAccountWebhooksValidateBeforeCall(Integer page, Integer size, String sort, String eventType, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllAccountWebhooksCall(page, size, sort, eventType, since, before, _callback);
}
/**
* List account webhooks Paginated
* List account webhooks in paginated form. Allows for page index, page size, and sort direction.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param eventType Optional event type (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageWebhookProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageWebhookProjection getAllAccountWebhooks(Integer page, Integer size, String sort, String eventType, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageWebhookProjection> localVarResp = getAllAccountWebhooksWithHttpInfo(page, size, sort, eventType, since, before);
return localVarResp.getData();
}
/**
* List account webhooks Paginated
* List account webhooks in paginated form. Allows for page index, page size, and sort direction.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param eventType Optional event type (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageWebhookProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageWebhookProjection> getAllAccountWebhooksWithHttpInfo(Integer page, Integer size, String sort, String eventType, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllAccountWebhooksValidateBeforeCall(page, size, sort, eventType, since, before, null);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List account webhooks Paginated (asynchronously)
* List account webhooks in paginated form. Allows for page index, page size, and sort direction.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param eventType Optional event type (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllAccountWebhooksAsync(Integer page, Integer size, String sort, String eventType, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageWebhookProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllAccountWebhooksValidateBeforeCall(page, size, sort, eventType, since, before, _callback);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAllWebhookResults
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllWebhookResultsCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/results";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (unseenOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unseenOnly", unseenOnly));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllWebhookResultsValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly, final ApiCallback _callback) throws ApiException {
return getAllWebhookResultsCall(page, size, sort, searchFilter, since, before, unseenOnly, _callback);
}
/**
* Get results for all webhooks
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @return PageWebhookResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageWebhookResult getAllWebhookResults(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly) throws ApiException {
ApiResponse<PageWebhookResult> localVarResp = getAllWebhookResultsWithHttpInfo(page, size, sort, searchFilter, since, before, unseenOnly);
return localVarResp.getData();
}
/**
* Get results for all webhooks
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @return ApiResponse<PageWebhookResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageWebhookResult> getAllWebhookResultsWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly) throws ApiException {
okhttp3.Call localVarCall = getAllWebhookResultsValidateBeforeCall(page, size, sort, searchFilter, since, before, unseenOnly, null);
Type localVarReturnType = new TypeToken<PageWebhookResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get results for all webhooks (asynchronously)
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllWebhookResultsAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly, final ApiCallback<PageWebhookResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllWebhookResultsValidateBeforeCall(page, size, sort, searchFilter, since, before, unseenOnly, _callback);
Type localVarReturnType = new TypeToken<PageWebhookResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAllWebhooks
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param inboxId Filter by inboxId (optional)
* @param phoneId Filter by phoneId (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllWebhooksCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, UUID inboxId, UUID phoneId, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/paginated";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (phoneId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("phoneId", phoneId));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllWebhooksValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, UUID inboxId, UUID phoneId, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllWebhooksCall(page, size, sort, searchFilter, since, inboxId, phoneId, before, _callback);
}
/**
* List Webhooks Paginated
* List webhooks in paginated form. Allows for page index, page size, and sort direction.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param inboxId Filter by inboxId (optional)
* @param phoneId Filter by phoneId (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageWebhookProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageWebhookProjection getAllWebhooks(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, UUID inboxId, UUID phoneId, OffsetDateTime before) throws ApiException {
ApiResponse<PageWebhookProjection> localVarResp = getAllWebhooksWithHttpInfo(page, size, sort, searchFilter, since, inboxId, phoneId, before);
return localVarResp.getData();
}
/**
* List Webhooks Paginated
* List webhooks in paginated form. Allows for page index, page size, and sort direction.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param inboxId Filter by inboxId (optional)
* @param phoneId Filter by phoneId (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageWebhookProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageWebhookProjection> getAllWebhooksWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, UUID inboxId, UUID phoneId, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllWebhooksValidateBeforeCall(page, size, sort, searchFilter, since, inboxId, phoneId, before, null);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List Webhooks Paginated (asynchronously)
* List webhooks in paginated form. Allows for page index, page size, and sort direction.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param inboxId Filter by inboxId (optional)
* @param phoneId Filter by phoneId (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllWebhooksAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, UUID inboxId, UUID phoneId, OffsetDateTime before, final ApiCallback<PageWebhookProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllWebhooksValidateBeforeCall(page, size, sort, searchFilter, since, inboxId, phoneId, before, _callback);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxWebhooksPaginated
* @param inboxId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxWebhooksPaginatedCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/webhooks/paginated"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxWebhooksPaginatedValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getInboxWebhooksPaginated(Async)");
}
return getInboxWebhooksPaginatedCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* Get paginated webhooks for an Inbox
*
* @param inboxId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageWebhookProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageWebhookProjection getInboxWebhooksPaginated(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageWebhookProjection> localVarResp = getInboxWebhooksPaginatedWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* Get paginated webhooks for an Inbox
*
* @param inboxId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageWebhookProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageWebhookProjection> getInboxWebhooksPaginatedWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxWebhooksPaginatedValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get paginated webhooks for an Inbox (asynchronously)
*
* @param inboxId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxWebhooksPaginatedAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageWebhookProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxWebhooksPaginatedValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getJsonSchemaForWebhookEvent
* @param event (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getJsonSchemaForWebhookEventCall(String event, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/schema";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (event != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("event", event));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getJsonSchemaForWebhookEventValidateBeforeCall(String event, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'event' is set
if (event == null) {
throw new ApiException("Missing the required parameter 'event' when calling getJsonSchemaForWebhookEvent(Async)");
}
return getJsonSchemaForWebhookEventCall(event, _callback);
}
/**
*
* Get JSON Schema definition for webhook payload by event
* @param event (required)
* @return JSONSchemaDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public JSONSchemaDto getJsonSchemaForWebhookEvent(String event) throws ApiException {
ApiResponse<JSONSchemaDto> localVarResp = getJsonSchemaForWebhookEventWithHttpInfo(event);
return localVarResp.getData();
}
/**
*
* Get JSON Schema definition for webhook payload by event
* @param event (required)
* @return ApiResponse<JSONSchemaDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<JSONSchemaDto> getJsonSchemaForWebhookEventWithHttpInfo(String event) throws ApiException {
okhttp3.Call localVarCall = getJsonSchemaForWebhookEventValidateBeforeCall(event, null);
Type localVarReturnType = new TypeToken<JSONSchemaDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get JSON Schema definition for webhook payload by event
* @param event (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getJsonSchemaForWebhookEventAsync(String event, final ApiCallback<JSONSchemaDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getJsonSchemaForWebhookEventValidateBeforeCall(event, _callback);
Type localVarReturnType = new TypeToken<JSONSchemaDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getJsonSchemaForWebhookPayload
* @param webhookId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getJsonSchemaForWebhookPayloadCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}/schema"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getJsonSchemaForWebhookPayloadValidateBeforeCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling getJsonSchemaForWebhookPayload(Async)");
}
return getJsonSchemaForWebhookPayloadCall(webhookId, _callback);
}
/**
*
* Get JSON Schema definition for webhook payload
* @param webhookId (required)
* @return JSONSchemaDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public JSONSchemaDto getJsonSchemaForWebhookPayload(UUID webhookId) throws ApiException {
ApiResponse<JSONSchemaDto> localVarResp = getJsonSchemaForWebhookPayloadWithHttpInfo(webhookId);
return localVarResp.getData();
}
/**
*
* Get JSON Schema definition for webhook payload
* @param webhookId (required)
* @return ApiResponse<JSONSchemaDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<JSONSchemaDto> getJsonSchemaForWebhookPayloadWithHttpInfo(UUID webhookId) throws ApiException {
okhttp3.Call localVarCall = getJsonSchemaForWebhookPayloadValidateBeforeCall(webhookId, null);
Type localVarReturnType = new TypeToken<JSONSchemaDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get JSON Schema definition for webhook payload
* @param webhookId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getJsonSchemaForWebhookPayloadAsync(UUID webhookId, final ApiCallback<JSONSchemaDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getJsonSchemaForWebhookPayloadValidateBeforeCall(webhookId, _callback);
Type localVarReturnType = new TypeToken<JSONSchemaDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPhoneNumberWebhooksPaginated
* @param phoneId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhoneNumberWebhooksPaginatedCall(UUID phoneId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/numbers/{phoneId}/webhooks/paginated"
.replace("{" + "phoneId" + "}", localVarApiClient.escapeString(phoneId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getPhoneNumberWebhooksPaginatedValidateBeforeCall(UUID phoneId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'phoneId' is set
if (phoneId == null) {
throw new ApiException("Missing the required parameter 'phoneId' when calling getPhoneNumberWebhooksPaginated(Async)");
}
return getPhoneNumberWebhooksPaginatedCall(phoneId, page, size, sort, since, before, _callback);
}
/**
* Get paginated webhooks for a phone number
*
* @param phoneId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageWebhookProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageWebhookProjection getPhoneNumberWebhooksPaginated(UUID phoneId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageWebhookProjection> localVarResp = getPhoneNumberWebhooksPaginatedWithHttpInfo(phoneId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get paginated webhooks for a phone number
*
* @param phoneId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageWebhookProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageWebhookProjection> getPhoneNumberWebhooksPaginatedWithHttpInfo(UUID phoneId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getPhoneNumberWebhooksPaginatedValidateBeforeCall(phoneId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get paginated webhooks for a phone number (asynchronously)
*
* @param phoneId (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhoneNumberWebhooksPaginatedAsync(UUID phoneId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageWebhookProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getPhoneNumberWebhooksPaginatedValidateBeforeCall(phoneId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageWebhookProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayload
* @param eventName (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadCall(String eventName, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (eventName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("eventName", eventName));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadValidateBeforeCall(String eventName, final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadCall(eventName, _callback);
}
/**
*
* Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.
* @param eventName (optional)
* @return AbstractWebhookPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public AbstractWebhookPayload getTestWebhookPayload(String eventName) throws ApiException {
ApiResponse<AbstractWebhookPayload> localVarResp = getTestWebhookPayloadWithHttpInfo(eventName);
return localVarResp.getData();
}
/**
*
* Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.
* @param eventName (optional)
* @return ApiResponse<AbstractWebhookPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<AbstractWebhookPayload> getTestWebhookPayloadWithHttpInfo(String eventName) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadValidateBeforeCall(eventName, null);
Type localVarReturnType = new TypeToken<AbstractWebhookPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.
* @param eventName (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadAsync(String eventName, final ApiCallback<AbstractWebhookPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadValidateBeforeCall(eventName, _callback);
Type localVarReturnType = new TypeToken<AbstractWebhookPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadBounce
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadBounceCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/email-bounce-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadBounceValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadBounceCall(_callback);
}
/**
*
* Get webhook test payload for bounce
* @return WebhookBouncePayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookBouncePayload getTestWebhookPayloadBounce() throws ApiException {
ApiResponse<WebhookBouncePayload> localVarResp = getTestWebhookPayloadBounceWithHttpInfo();
return localVarResp.getData();
}
/**
*
* Get webhook test payload for bounce
* @return ApiResponse<WebhookBouncePayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookBouncePayload> getTestWebhookPayloadBounceWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadBounceValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookBouncePayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get webhook test payload for bounce
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadBounceAsync(final ApiCallback<WebhookBouncePayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadBounceValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookBouncePayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadBounceRecipient
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadBounceRecipientCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/email-bounce-recipient-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadBounceRecipientValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadBounceRecipientCall(_callback);
}
/**
*
* Get webhook test payload for bounce recipient
* @return WebhookBounceRecipientPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookBounceRecipientPayload getTestWebhookPayloadBounceRecipient() throws ApiException {
ApiResponse<WebhookBounceRecipientPayload> localVarResp = getTestWebhookPayloadBounceRecipientWithHttpInfo();
return localVarResp.getData();
}
/**
*
* Get webhook test payload for bounce recipient
* @return ApiResponse<WebhookBounceRecipientPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookBounceRecipientPayload> getTestWebhookPayloadBounceRecipientWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadBounceRecipientValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookBounceRecipientPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get webhook test payload for bounce recipient
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadBounceRecipientAsync(final ApiCallback<WebhookBounceRecipientPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadBounceRecipientValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookBounceRecipientPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadDeliveryStatus
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadDeliveryStatusCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/delivery-status-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadDeliveryStatusValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadDeliveryStatusCall(_callback);
}
/**
* Get webhook test payload for delivery status event
*
* @return WebhookDeliveryStatusPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookDeliveryStatusPayload getTestWebhookPayloadDeliveryStatus() throws ApiException {
ApiResponse<WebhookDeliveryStatusPayload> localVarResp = getTestWebhookPayloadDeliveryStatusWithHttpInfo();
return localVarResp.getData();
}
/**
* Get webhook test payload for delivery status event
*
* @return ApiResponse<WebhookDeliveryStatusPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookDeliveryStatusPayload> getTestWebhookPayloadDeliveryStatusWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadDeliveryStatusValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookDeliveryStatusPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get webhook test payload for delivery status event (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadDeliveryStatusAsync(final ApiCallback<WebhookDeliveryStatusPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadDeliveryStatusValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookDeliveryStatusPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadEmailOpened
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadEmailOpenedCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/email-opened-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadEmailOpenedValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadEmailOpenedCall(_callback);
}
/**
*
* Get webhook test payload for email opened event
* @return WebhookEmailOpenedPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookEmailOpenedPayload getTestWebhookPayloadEmailOpened() throws ApiException {
ApiResponse<WebhookEmailOpenedPayload> localVarResp = getTestWebhookPayloadEmailOpenedWithHttpInfo();
return localVarResp.getData();
}
/**
*
* Get webhook test payload for email opened event
* @return ApiResponse<WebhookEmailOpenedPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookEmailOpenedPayload> getTestWebhookPayloadEmailOpenedWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadEmailOpenedValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookEmailOpenedPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get webhook test payload for email opened event
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadEmailOpenedAsync(final ApiCallback<WebhookEmailOpenedPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadEmailOpenedValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookEmailOpenedPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadEmailRead
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadEmailReadCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/email-read-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadEmailReadValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadEmailReadCall(_callback);
}
/**
*
* Get webhook test payload for email opened event
* @return WebhookEmailReadPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookEmailReadPayload getTestWebhookPayloadEmailRead() throws ApiException {
ApiResponse<WebhookEmailReadPayload> localVarResp = getTestWebhookPayloadEmailReadWithHttpInfo();
return localVarResp.getData();
}
/**
*
* Get webhook test payload for email opened event
* @return ApiResponse<WebhookEmailReadPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookEmailReadPayload> getTestWebhookPayloadEmailReadWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadEmailReadValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookEmailReadPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get webhook test payload for email opened event
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadEmailReadAsync(final ApiCallback<WebhookEmailReadPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadEmailReadValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookEmailReadPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadForWebhook
* @param webhookId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadForWebhookCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}/example"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadForWebhookValidateBeforeCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling getTestWebhookPayloadForWebhook(Async)");
}
return getTestWebhookPayloadForWebhookCall(webhookId, _callback);
}
/**
*
* Get example payload for webhook
* @param webhookId (required)
* @return AbstractWebhookPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public AbstractWebhookPayload getTestWebhookPayloadForWebhook(UUID webhookId) throws ApiException {
ApiResponse<AbstractWebhookPayload> localVarResp = getTestWebhookPayloadForWebhookWithHttpInfo(webhookId);
return localVarResp.getData();
}
/**
*
* Get example payload for webhook
* @param webhookId (required)
* @return ApiResponse<AbstractWebhookPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<AbstractWebhookPayload> getTestWebhookPayloadForWebhookWithHttpInfo(UUID webhookId) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadForWebhookValidateBeforeCall(webhookId, null);
Type localVarReturnType = new TypeToken<AbstractWebhookPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get example payload for webhook
* @param webhookId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadForWebhookAsync(UUID webhookId, final ApiCallback<AbstractWebhookPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadForWebhookValidateBeforeCall(webhookId, _callback);
Type localVarReturnType = new TypeToken<AbstractWebhookPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadNewAttachment
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewAttachmentCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/new-attachment-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadNewAttachmentValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadNewAttachmentCall(_callback);
}
/**
* Get webhook test payload for new attachment event
*
* @return WebhookNewAttachmentPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookNewAttachmentPayload getTestWebhookPayloadNewAttachment() throws ApiException {
ApiResponse<WebhookNewAttachmentPayload> localVarResp = getTestWebhookPayloadNewAttachmentWithHttpInfo();
return localVarResp.getData();
}
/**
* Get webhook test payload for new attachment event
*
* @return ApiResponse<WebhookNewAttachmentPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookNewAttachmentPayload> getTestWebhookPayloadNewAttachmentWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewAttachmentValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookNewAttachmentPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get webhook test payload for new attachment event (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewAttachmentAsync(final ApiCallback<WebhookNewAttachmentPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewAttachmentValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookNewAttachmentPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadNewContact
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewContactCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/new-contact-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadNewContactValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadNewContactCall(_callback);
}
/**
* Get webhook test payload for new contact event
*
* @return WebhookNewContactPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookNewContactPayload getTestWebhookPayloadNewContact() throws ApiException {
ApiResponse<WebhookNewContactPayload> localVarResp = getTestWebhookPayloadNewContactWithHttpInfo();
return localVarResp.getData();
}
/**
* Get webhook test payload for new contact event
*
* @return ApiResponse<WebhookNewContactPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookNewContactPayload> getTestWebhookPayloadNewContactWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewContactValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookNewContactPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get webhook test payload for new contact event (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewContactAsync(final ApiCallback<WebhookNewContactPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewContactValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookNewContactPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadNewEmail
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewEmailCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/new-email-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadNewEmailValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadNewEmailCall(_callback);
}
/**
* Get webhook test payload for new email event
*
* @return WebhookNewEmailPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookNewEmailPayload getTestWebhookPayloadNewEmail() throws ApiException {
ApiResponse<WebhookNewEmailPayload> localVarResp = getTestWebhookPayloadNewEmailWithHttpInfo();
return localVarResp.getData();
}
/**
* Get webhook test payload for new email event
*
* @return ApiResponse<WebhookNewEmailPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookNewEmailPayload> getTestWebhookPayloadNewEmailWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewEmailValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookNewEmailPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get webhook test payload for new email event (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewEmailAsync(final ApiCallback<WebhookNewEmailPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewEmailValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookNewEmailPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTestWebhookPayloadNewSms
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewSmsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/test/new-sms-payload";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTestWebhookPayloadNewSmsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTestWebhookPayloadNewSmsCall(_callback);
}
/**
* Get webhook test payload for new sms event
*
* @return WebhookNewSmsPayload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookNewSmsPayload getTestWebhookPayloadNewSms() throws ApiException {
ApiResponse<WebhookNewSmsPayload> localVarResp = getTestWebhookPayloadNewSmsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get webhook test payload for new sms event
*
* @return ApiResponse<WebhookNewSmsPayload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookNewSmsPayload> getTestWebhookPayloadNewSmsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewSmsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<WebhookNewSmsPayload>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get webhook test payload for new sms event (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTestWebhookPayloadNewSmsAsync(final ApiCallback<WebhookNewSmsPayload> _callback) throws ApiException {
okhttp3.Call localVarCall = getTestWebhookPayloadNewSmsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<WebhookNewSmsPayload>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getWebhook
* @param webhookId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWebhookValidateBeforeCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling getWebhook(Async)");
}
return getWebhookCall(webhookId, _callback);
}
/**
* Get a webhook
*
* @param webhookId (required)
* @return WebhookDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookDto getWebhook(UUID webhookId) throws ApiException {
ApiResponse<WebhookDto> localVarResp = getWebhookWithHttpInfo(webhookId);
return localVarResp.getData();
}
/**
* Get a webhook
*
* @param webhookId (required)
* @return ApiResponse<WebhookDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookDto> getWebhookWithHttpInfo(UUID webhookId) throws ApiException {
okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, null);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a webhook (asynchronously)
*
* @param webhookId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookAsync(UUID webhookId, final ApiCallback<WebhookDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getWebhookValidateBeforeCall(webhookId, _callback);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getWebhookResult
* @param webhookResultId Webhook Result ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookResultCall(UUID webhookResultId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/results/{webhookResultId}"
.replace("{" + "webhookResultId" + "}", localVarApiClient.escapeString(webhookResultId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWebhookResultValidateBeforeCall(UUID webhookResultId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookResultId' is set
if (webhookResultId == null) {
throw new ApiException("Missing the required parameter 'webhookResultId' when calling getWebhookResult(Async)");
}
return getWebhookResultCall(webhookResultId, _callback);
}
/**
* Get a webhook result for a webhook
*
* @param webhookResultId Webhook Result ID (required)
* @return WebhookResultDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookResultDto getWebhookResult(UUID webhookResultId) throws ApiException {
ApiResponse<WebhookResultDto> localVarResp = getWebhookResultWithHttpInfo(webhookResultId);
return localVarResp.getData();
}
/**
* Get a webhook result for a webhook
*
* @param webhookResultId Webhook Result ID (required)
* @return ApiResponse<WebhookResultDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookResultDto> getWebhookResultWithHttpInfo(UUID webhookResultId) throws ApiException {
okhttp3.Call localVarCall = getWebhookResultValidateBeforeCall(webhookResultId, null);
Type localVarReturnType = new TypeToken<WebhookResultDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a webhook result for a webhook (asynchronously)
*
* @param webhookResultId Webhook Result ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookResultAsync(UUID webhookResultId, final ApiCallback<WebhookResultDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getWebhookResultValidateBeforeCall(webhookResultId, _callback);
Type localVarReturnType = new TypeToken<WebhookResultDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getWebhookResults
* @param webhookId ID of webhook to get results for (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookResultsCall(UUID webhookId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}/results"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (unseenOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unseenOnly", unseenOnly));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWebhookResultsValidateBeforeCall(UUID webhookId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling getWebhookResults(Async)");
}
return getWebhookResultsCall(webhookId, page, size, sort, searchFilter, since, before, unseenOnly, _callback);
}
/**
* Get a webhook results for a webhook
*
* @param webhookId ID of webhook to get results for (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @return PageWebhookResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageWebhookResult getWebhookResults(UUID webhookId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly) throws ApiException {
ApiResponse<PageWebhookResult> localVarResp = getWebhookResultsWithHttpInfo(webhookId, page, size, sort, searchFilter, since, before, unseenOnly);
return localVarResp.getData();
}
/**
* Get a webhook results for a webhook
*
* @param webhookId ID of webhook to get results for (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @return ApiResponse<PageWebhookResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageWebhookResult> getWebhookResultsWithHttpInfo(UUID webhookId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly) throws ApiException {
okhttp3.Call localVarCall = getWebhookResultsValidateBeforeCall(webhookId, page, size, sort, searchFilter, since, before, unseenOnly, null);
Type localVarReturnType = new TypeToken<PageWebhookResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a webhook results for a webhook (asynchronously)
*
* @param webhookId ID of webhook to get results for (required)
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param unseenOnly Filter for unseen exceptions only (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookResultsAsync(UUID webhookId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean unseenOnly, final ApiCallback<PageWebhookResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getWebhookResultsValidateBeforeCall(webhookId, page, size, sort, searchFilter, since, before, unseenOnly, _callback);
Type localVarReturnType = new TypeToken<PageWebhookResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getWebhookResultsUnseenErrorCount
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookResultsUnseenErrorCountCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/results/unseen-count";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWebhookResultsUnseenErrorCountValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getWebhookResultsUnseenErrorCountCall(_callback);
}
/**
* Get count of unseen webhook results with error status
*
* @return UnseenErrorCountDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public UnseenErrorCountDto getWebhookResultsUnseenErrorCount() throws ApiException {
ApiResponse<UnseenErrorCountDto> localVarResp = getWebhookResultsUnseenErrorCountWithHttpInfo();
return localVarResp.getData();
}
/**
* Get count of unseen webhook results with error status
*
* @return ApiResponse<UnseenErrorCountDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<UnseenErrorCountDto> getWebhookResultsUnseenErrorCountWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getWebhookResultsUnseenErrorCountValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<UnseenErrorCountDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get count of unseen webhook results with error status (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getWebhookResultsUnseenErrorCountAsync(final ApiCallback<UnseenErrorCountDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getWebhookResultsUnseenErrorCountValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<UnseenErrorCountDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getWebhooks
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public okhttp3.Call getWebhooksCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/webhooks"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call getWebhooksValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getWebhooks(Async)");
}
return getWebhooksCall(inboxId, _callback);
}
/**
* Get all webhooks for an Inbox
*
* @param inboxId (required)
* @return List<WebhookDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public List<WebhookDto> getWebhooks(UUID inboxId) throws ApiException {
ApiResponse<List<WebhookDto>> localVarResp = getWebhooksWithHttpInfo(inboxId);
return localVarResp.getData();
}
/**
* Get all webhooks for an Inbox
*
* @param inboxId (required)
* @return ApiResponse<List<WebhookDto>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public ApiResponse<List<WebhookDto>> getWebhooksWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(inboxId, null);
Type localVarReturnType = new TypeToken<List<WebhookDto>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all webhooks for an Inbox (asynchronously)
*
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public okhttp3.Call getWebhooksAsync(UUID inboxId, final ApiCallback<List<WebhookDto>> _callback) throws ApiException {
okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(inboxId, _callback);
Type localVarReturnType = new TypeToken<List<WebhookDto>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for redriveWebhookResult
* @param webhookResultId Webhook Result ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call redriveWebhookResultCall(UUID webhookResultId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/results/{webhookResultId}/redrive"
.replace("{" + "webhookResultId" + "}", localVarApiClient.escapeString(webhookResultId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call redriveWebhookResultValidateBeforeCall(UUID webhookResultId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookResultId' is set
if (webhookResultId == null) {
throw new ApiException("Missing the required parameter 'webhookResultId' when calling redriveWebhookResult(Async)");
}
return redriveWebhookResultCall(webhookResultId, _callback);
}
/**
* Get a webhook result and try to resend the original webhook payload
* Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.
* @param webhookResultId Webhook Result ID (required)
* @return WebhookRedriveResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookRedriveResult redriveWebhookResult(UUID webhookResultId) throws ApiException {
ApiResponse<WebhookRedriveResult> localVarResp = redriveWebhookResultWithHttpInfo(webhookResultId);
return localVarResp.getData();
}
/**
* Get a webhook result and try to resend the original webhook payload
* Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.
* @param webhookResultId Webhook Result ID (required)
* @return ApiResponse<WebhookRedriveResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookRedriveResult> redriveWebhookResultWithHttpInfo(UUID webhookResultId) throws ApiException {
okhttp3.Call localVarCall = redriveWebhookResultValidateBeforeCall(webhookResultId, null);
Type localVarReturnType = new TypeToken<WebhookRedriveResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a webhook result and try to resend the original webhook payload (asynchronously)
* Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.
* @param webhookResultId Webhook Result ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call redriveWebhookResultAsync(UUID webhookResultId, final ApiCallback<WebhookRedriveResult> _callback) throws ApiException {
okhttp3.Call localVarCall = redriveWebhookResultValidateBeforeCall(webhookResultId, _callback);
Type localVarReturnType = new TypeToken<WebhookRedriveResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for sendTestData
* @param webhookId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendTestDataCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}/test"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendTestDataValidateBeforeCall(UUID webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling sendTestData(Async)");
}
return sendTestDataCall(webhookId, _callback);
}
/**
* Send webhook test data
*
* @param webhookId (required)
* @return WebhookTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public WebhookTestResult sendTestData(UUID webhookId) throws ApiException {
ApiResponse<WebhookTestResult> localVarResp = sendTestDataWithHttpInfo(webhookId);
return localVarResp.getData();
}
/**
* Send webhook test data
*
* @param webhookId (required)
* @return ApiResponse<WebhookTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookTestResult> sendTestDataWithHttpInfo(UUID webhookId) throws ApiException {
okhttp3.Call localVarCall = sendTestDataValidateBeforeCall(webhookId, null);
Type localVarReturnType = new TypeToken<WebhookTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Send webhook test data (asynchronously)
*
* @param webhookId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendTestDataAsync(UUID webhookId, final ApiCallback<WebhookTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = sendTestDataValidateBeforeCall(webhookId, _callback);
Type localVarReturnType = new TypeToken<WebhookTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateWebhookHeaders
* @param webhookId (required)
* @param webhookHeaders (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateWebhookHeadersCall(UUID webhookId, WebhookHeaders webhookHeaders, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = webhookHeaders;
// create path and map variables
String localVarPath = "/webhooks/{webhookId}/headers"
.replace("{" + "webhookId" + "}", localVarApiClient.escapeString(webhookId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateWebhookHeadersValidateBeforeCall(UUID webhookId, WebhookHeaders webhookHeaders, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling updateWebhookHeaders(Async)");
}
// verify the required parameter 'webhookHeaders' is set
if (webhookHeaders == null) {
throw new ApiException("Missing the required parameter 'webhookHeaders' when calling updateWebhookHeaders(Async)");
}
return updateWebhookHeadersCall(webhookId, webhookHeaders, _callback);
}
/**
* Update a webhook request headers
*
* @param webhookId (required)
* @param webhookHeaders (required)
* @return WebhookDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public WebhookDto updateWebhookHeaders(UUID webhookId, WebhookHeaders webhookHeaders) throws ApiException {
ApiResponse<WebhookDto> localVarResp = updateWebhookHeadersWithHttpInfo(webhookId, webhookHeaders);
return localVarResp.getData();
}
/**
* Update a webhook request headers
*
* @param webhookId (required)
* @param webhookHeaders (required)
* @return ApiResponse<WebhookDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<WebhookDto> updateWebhookHeadersWithHttpInfo(UUID webhookId, WebhookHeaders webhookHeaders) throws ApiException {
okhttp3.Call localVarCall = updateWebhookHeadersValidateBeforeCall(webhookId, webhookHeaders, null);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update a webhook request headers (asynchronously)
*
* @param webhookId (required)
* @param webhookHeaders (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateWebhookHeadersAsync(UUID webhookId, WebhookHeaders webhookHeaders, final ApiCallback<WebhookDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateWebhookHeadersValidateBeforeCall(webhookId, webhookHeaders, _callback);
Type localVarReturnType = new TypeToken<WebhookDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for verifyWebhookSignature
* @param verifyWebhookSignatureOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call verifyWebhookSignatureCall(VerifyWebhookSignatureOptions verifyWebhookSignatureOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = verifyWebhookSignatureOptions;
// create path and map variables
String localVarPath = "/webhooks/verify";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call verifyWebhookSignatureValidateBeforeCall(VerifyWebhookSignatureOptions verifyWebhookSignatureOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'verifyWebhookSignatureOptions' is set
if (verifyWebhookSignatureOptions == null) {
throw new ApiException("Missing the required parameter 'verifyWebhookSignatureOptions' when calling verifyWebhookSignature(Async)");
}
return verifyWebhookSignatureCall(verifyWebhookSignatureOptions, _callback);
}
/**
* Verify a webhook payload signature
* Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.
* @param verifyWebhookSignatureOptions (required)
* @return VerifyWebhookSignatureResults
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public VerifyWebhookSignatureResults verifyWebhookSignature(VerifyWebhookSignatureOptions verifyWebhookSignatureOptions) throws ApiException {
ApiResponse<VerifyWebhookSignatureResults> localVarResp = verifyWebhookSignatureWithHttpInfo(verifyWebhookSignatureOptions);
return localVarResp.getData();
}
/**
* Verify a webhook payload signature
* Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.
* @param verifyWebhookSignatureOptions (required)
* @return ApiResponse<VerifyWebhookSignatureResults>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<VerifyWebhookSignatureResults> verifyWebhookSignatureWithHttpInfo(VerifyWebhookSignatureOptions verifyWebhookSignatureOptions) throws ApiException {
okhttp3.Call localVarCall = verifyWebhookSignatureValidateBeforeCall(verifyWebhookSignatureOptions, null);
Type localVarReturnType = new TypeToken<VerifyWebhookSignatureResults>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Verify a webhook payload signature (asynchronously)
* Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.
* @param verifyWebhookSignatureOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call verifyWebhookSignatureAsync(VerifyWebhookSignatureOptions verifyWebhookSignatureOptions, final ApiCallback<VerifyWebhookSignatureResults> _callback) throws ApiException {
okhttp3.Call localVarCall = verifyWebhookSignatureValidateBeforeCall(verifyWebhookSignatureOptions, _callback);
Type localVarReturnType = new TypeToken<VerifyWebhookSignatureResults>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.Email;
import com.mailslurp.models.EmailPreview;
import com.mailslurp.models.MatchOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.SmsDto;
import com.mailslurp.models.SmsPreview;
import java.util.UUID;
import com.mailslurp.models.WaitForConditions;
import com.mailslurp.models.WaitForSingleSmsOptions;
import com.mailslurp.models.WaitForSmsConditions;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class WaitForControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public WaitForControllerApi() {
this(Configuration.getDefaultApiClient());
}
public WaitForControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for waitFor
* @param waitForConditions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForCall(WaitForConditions waitForConditions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = waitForConditions;
// create path and map variables
String localVarPath = "/waitFor";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForValidateBeforeCall(WaitForConditions waitForConditions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'waitForConditions' is set
if (waitForConditions == null) {
throw new ApiException("Missing the required parameter 'waitForConditions' when calling waitFor(Async)");
}
return waitForCall(waitForConditions, _callback);
}
/**
* Wait for an email to match the provided filter conditions such as subject contains keyword.
* Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met
* @param waitForConditions (required)
* @return List<EmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<EmailPreview> waitFor(WaitForConditions waitForConditions) throws ApiException {
ApiResponse<List<EmailPreview>> localVarResp = waitForWithHttpInfo(waitForConditions);
return localVarResp.getData();
}
/**
* Wait for an email to match the provided filter conditions such as subject contains keyword.
* Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met
* @param waitForConditions (required)
* @return ApiResponse<List<EmailPreview>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<EmailPreview>> waitForWithHttpInfo(WaitForConditions waitForConditions) throws ApiException {
okhttp3.Call localVarCall = waitForValidateBeforeCall(waitForConditions, null);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for an email to match the provided filter conditions such as subject contains keyword. (asynchronously)
* Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met
* @param waitForConditions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForAsync(WaitForConditions waitForConditions, final ApiCallback<List<EmailPreview>> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForValidateBeforeCall(waitForConditions, _callback);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForEmailCount
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater that 1 (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForEmailCountCall(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/waitForEmailCount";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (count != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", count));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (delay != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("delay", delay));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForEmailCountValidateBeforeCall(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling waitForEmailCount(Async)");
}
// verify the required parameter 'count' is set
if (count == null) {
throw new ApiException("Missing the required parameter 'count' when calling waitForEmailCount(Async)");
}
return waitForEmailCountCall(inboxId, count, timeout, unreadOnly, before, since, sort, delay, _callback);
}
/**
* Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs
* If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater that 1 (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return List<EmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<EmailPreview> waitForEmailCount(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay) throws ApiException {
ApiResponse<List<EmailPreview>> localVarResp = waitForEmailCountWithHttpInfo(inboxId, count, timeout, unreadOnly, before, since, sort, delay);
return localVarResp.getData();
}
/**
* Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs
* If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater that 1 (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return ApiResponse<List<EmailPreview>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<EmailPreview>> waitForEmailCountWithHttpInfo(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay) throws ApiException {
okhttp3.Call localVarCall = waitForEmailCountValidateBeforeCall(inboxId, count, timeout, unreadOnly, before, since, sort, delay, null);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs (asynchronously)
* If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater that 1 (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForEmailCountAsync(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, final ApiCallback<List<EmailPreview>> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForEmailCountValidateBeforeCall(inboxId, count, timeout, unreadOnly, before, since, sort, delay, _callback);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForLatestEmail
* @param inboxId Id of the inbox we are fetching emails from (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only. (optional, default to false)
* @param before Filter for emails that were before after the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForLatestEmailCall(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/waitForLatestEmail";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (delay != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("delay", delay));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForLatestEmailValidateBeforeCall(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, final ApiCallback _callback) throws ApiException {
return waitForLatestEmailCall(inboxId, timeout, unreadOnly, before, since, sort, delay, _callback);
}
/**
* Fetch inbox's latest email or if empty wait for an email to arrive
* Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set `unreadOnly=true` or see the other receive methods such as `waitForNthEmail` or `waitForEmailCount`.
* @param inboxId Id of the inbox we are fetching emails from (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only. (optional, default to false)
* @param before Filter for emails that were before after the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email waitForLatestEmail(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay) throws ApiException {
ApiResponse<Email> localVarResp = waitForLatestEmailWithHttpInfo(inboxId, timeout, unreadOnly, before, since, sort, delay);
return localVarResp.getData();
}
/**
* Fetch inbox's latest email or if empty wait for an email to arrive
* Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set `unreadOnly=true` or see the other receive methods such as `waitForNthEmail` or `waitForEmailCount`.
* @param inboxId Id of the inbox we are fetching emails from (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only. (optional, default to false)
* @param before Filter for emails that were before after the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> waitForLatestEmailWithHttpInfo(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay) throws ApiException {
okhttp3.Call localVarCall = waitForLatestEmailValidateBeforeCall(inboxId, timeout, unreadOnly, before, since, sort, delay, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Fetch inbox's latest email or if empty wait for an email to arrive (asynchronously)
* Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set `unreadOnly=true` or see the other receive methods such as `waitForNthEmail` or `waitForEmailCount`.
* @param inboxId Id of the inbox we are fetching emails from (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only. (optional, default to false)
* @param before Filter for emails that were before after the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForLatestEmailAsync(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForLatestEmailValidateBeforeCall(inboxId, timeout, unreadOnly, before, since, sort, delay, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForLatestSms
* @param waitForSingleSmsOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForLatestSmsCall(WaitForSingleSmsOptions waitForSingleSmsOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = waitForSingleSmsOptions;
// create path and map variables
String localVarPath = "/waitForLatestSms";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForLatestSmsValidateBeforeCall(WaitForSingleSmsOptions waitForSingleSmsOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'waitForSingleSmsOptions' is set
if (waitForSingleSmsOptions == null) {
throw new ApiException("Missing the required parameter 'waitForSingleSmsOptions' when calling waitForLatestSms(Async)");
}
return waitForLatestSmsCall(waitForSingleSmsOptions, _callback);
}
/**
* Wait for the latest SMS message to match the provided filter conditions such as body contains keyword.
* Wait until a phone number meets given conditions or return immediately if already met
* @param waitForSingleSmsOptions (required)
* @return SmsDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SmsDto waitForLatestSms(WaitForSingleSmsOptions waitForSingleSmsOptions) throws ApiException {
ApiResponse<SmsDto> localVarResp = waitForLatestSmsWithHttpInfo(waitForSingleSmsOptions);
return localVarResp.getData();
}
/**
* Wait for the latest SMS message to match the provided filter conditions such as body contains keyword.
* Wait until a phone number meets given conditions or return immediately if already met
* @param waitForSingleSmsOptions (required)
* @return ApiResponse<SmsDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SmsDto> waitForLatestSmsWithHttpInfo(WaitForSingleSmsOptions waitForSingleSmsOptions) throws ApiException {
okhttp3.Call localVarCall = waitForLatestSmsValidateBeforeCall(waitForSingleSmsOptions, null);
Type localVarReturnType = new TypeToken<SmsDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. (asynchronously)
* Wait until a phone number meets given conditions or return immediately if already met
* @param waitForSingleSmsOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForLatestSmsAsync(WaitForSingleSmsOptions waitForSingleSmsOptions, final ApiCallback<SmsDto> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForLatestSmsValidateBeforeCall(waitForSingleSmsOptions, _callback);
Type localVarReturnType = new TypeToken<SmsDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForMatchingEmails
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater or equal to 1 (required)
* @param matchOptions (required)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForMatchingEmailsCall(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = matchOptions;
// create path and map variables
String localVarPath = "/waitForMatchingEmails";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (count != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", count));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (delay != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("delay", delay));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForMatchingEmailsValidateBeforeCall(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling waitForMatchingEmails(Async)");
}
// verify the required parameter 'count' is set
if (count == null) {
throw new ApiException("Missing the required parameter 'count' when calling waitForMatchingEmails(Async)");
}
// verify the required parameter 'matchOptions' is set
if (matchOptions == null) {
throw new ApiException("Missing the required parameter 'matchOptions' when calling waitForMatchingEmails(Async)");
}
return waitForMatchingEmailsCall(inboxId, count, matchOptions, before, since, sort, delay, timeout, unreadOnly, _callback);
}
/**
* Wait or return list of emails that match simple matching patterns
* Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater or equal to 1 (required)
* @param matchOptions (required)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @return List<EmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<EmailPreview> waitForMatchingEmails(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly) throws ApiException {
ApiResponse<List<EmailPreview>> localVarResp = waitForMatchingEmailsWithHttpInfo(inboxId, count, matchOptions, before, since, sort, delay, timeout, unreadOnly);
return localVarResp.getData();
}
/**
* Wait or return list of emails that match simple matching patterns
* Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater or equal to 1 (required)
* @param matchOptions (required)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @return ApiResponse<List<EmailPreview>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<EmailPreview>> waitForMatchingEmailsWithHttpInfo(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly) throws ApiException {
okhttp3.Call localVarCall = waitForMatchingEmailsValidateBeforeCall(inboxId, count, matchOptions, before, since, sort, delay, timeout, unreadOnly, null);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait or return list of emails that match simple matching patterns (asynchronously)
* Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
* @param inboxId Id of the inbox we are fetching emails from (required)
* @param count Number of emails to wait for. Must be greater or equal to 1 (required)
* @param matchOptions (required)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForMatchingEmailsAsync(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly, final ApiCallback<List<EmailPreview>> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForMatchingEmailsValidateBeforeCall(inboxId, count, matchOptions, before, since, sort, delay, timeout, unreadOnly, _callback);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForMatchingFirstEmail
* @param inboxId Id of the inbox we are matching an email for (required)
* @param matchOptions (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForMatchingFirstEmailCall(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = matchOptions;
// create path and map variables
String localVarPath = "/waitForMatchingFirstEmail";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (delay != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("delay", delay));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForMatchingFirstEmailValidateBeforeCall(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling waitForMatchingFirstEmail(Async)");
}
// verify the required parameter 'matchOptions' is set
if (matchOptions == null) {
throw new ApiException("Missing the required parameter 'matchOptions' when calling waitForMatchingFirstEmail(Async)");
}
return waitForMatchingFirstEmailCall(inboxId, matchOptions, timeout, unreadOnly, since, before, sort, delay, _callback);
}
/**
* Wait for or return the first email that matches provided MatchOptions array
* Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
* @param inboxId Id of the inbox we are matching an email for (required)
* @param matchOptions (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email waitForMatchingFirstEmail(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay) throws ApiException {
ApiResponse<Email> localVarResp = waitForMatchingFirstEmailWithHttpInfo(inboxId, matchOptions, timeout, unreadOnly, since, before, sort, delay);
return localVarResp.getData();
}
/**
* Wait for or return the first email that matches provided MatchOptions array
* Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
* @param inboxId Id of the inbox we are matching an email for (required)
* @param matchOptions (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> waitForMatchingFirstEmailWithHttpInfo(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay) throws ApiException {
okhttp3.Call localVarCall = waitForMatchingFirstEmailValidateBeforeCall(inboxId, matchOptions, timeout, unreadOnly, since, before, sort, delay, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for or return the first email that matches provided MatchOptions array (asynchronously)
* Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
* @param inboxId Id of the inbox we are matching an email for (required)
* @param matchOptions (required)
* @param timeout Max milliseconds to wait (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForMatchingFirstEmailAsync(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForMatchingFirstEmailValidateBeforeCall(inboxId, matchOptions, timeout, unreadOnly, since, before, sort, delay, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForNthEmail
* @param inboxId Id of the inbox you are fetching emails from (optional)
* @param index Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional, default to 0)
* @param timeout Max milliseconds to wait for the nth email if not already present (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForNthEmailCall(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/waitForNthEmail";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (index != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("index", index));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (delay != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("delay", delay));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForNthEmailValidateBeforeCall(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay, final ApiCallback _callback) throws ApiException {
return waitForNthEmailCall(inboxId, index, timeout, unreadOnly, since, before, sort, delay, _callback);
}
/**
* Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur.
* If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
* @param inboxId Id of the inbox you are fetching emails from (optional)
* @param index Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional, default to 0)
* @param timeout Max milliseconds to wait for the nth email if not already present (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email waitForNthEmail(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay) throws ApiException {
ApiResponse<Email> localVarResp = waitForNthEmailWithHttpInfo(inboxId, index, timeout, unreadOnly, since, before, sort, delay);
return localVarResp.getData();
}
/**
* Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur.
* If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
* @param inboxId Id of the inbox you are fetching emails from (optional)
* @param index Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional, default to 0)
* @param timeout Max milliseconds to wait for the nth email if not already present (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> waitForNthEmailWithHttpInfo(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay) throws ApiException {
okhttp3.Call localVarCall = waitForNthEmailValidateBeforeCall(inboxId, index, timeout, unreadOnly, since, before, sort, delay, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. (asynchronously)
* If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
* @param inboxId Id of the inbox you are fetching emails from (optional)
* @param index Zero based index of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass index=1 (optional, default to 0)
* @param timeout Max milliseconds to wait for the nth email if not already present (optional)
* @param unreadOnly Optional filter for unread only (optional, default to false)
* @param since Filter for emails that were received after the given timestamp (optional)
* @param before Filter for emails that were received before the given timestamp (optional)
* @param sort Sort direction (optional)
* @param delay Max milliseconds delay between calls (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForNthEmailAsync(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForNthEmailValidateBeforeCall(inboxId, index, timeout, unreadOnly, since, before, sort, delay, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForSms
* @param waitForSmsConditions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForSmsCall(WaitForSmsConditions waitForSmsConditions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = waitForSmsConditions;
// create path and map variables
String localVarPath = "/waitForSms";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForSmsValidateBeforeCall(WaitForSmsConditions waitForSmsConditions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'waitForSmsConditions' is set
if (waitForSmsConditions == null) {
throw new ApiException("Missing the required parameter 'waitForSmsConditions' when calling waitForSms(Async)");
}
return waitForSmsCall(waitForSmsConditions, _callback);
}
/**
* Wait for an SMS message to match the provided filter conditions such as body contains keyword.
* Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
* @param waitForSmsConditions (required)
* @return List<SmsPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<SmsPreview> waitForSms(WaitForSmsConditions waitForSmsConditions) throws ApiException {
ApiResponse<List<SmsPreview>> localVarResp = waitForSmsWithHttpInfo(waitForSmsConditions);
return localVarResp.getData();
}
/**
* Wait for an SMS message to match the provided filter conditions such as body contains keyword.
* Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
* @param waitForSmsConditions (required)
* @return ApiResponse<List<SmsPreview>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<SmsPreview>> waitForSmsWithHttpInfo(WaitForSmsConditions waitForSmsConditions) throws ApiException {
okhttp3.Call localVarCall = waitForSmsValidateBeforeCall(waitForSmsConditions, null);
Type localVarReturnType = new TypeToken<List<SmsPreview>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for an SMS message to match the provided filter conditions such as body contains keyword. (asynchronously)
* Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
* @param waitForSmsConditions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForSmsAsync(WaitForSmsConditions waitForSmsConditions, final ApiCallback<List<SmsPreview>> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForSmsValidateBeforeCall(waitForSmsConditions, _callback);
Type localVarReturnType = new TypeToken<List<SmsPreview>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.UserInfoDto;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class UserControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public UserControllerApi() {
this(Configuration.getDefaultApiClient());
}
public UserControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for getJsonPropertyAsString
* @param property JSON property name or dot separated path selector such as `a.b.c` (required)
* @param body (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getJsonPropertyAsStringCall(String property, Object body, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/user/json/pluck";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (property != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("property", property));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getJsonPropertyAsStringValidateBeforeCall(String property, Object body, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'property' is set
if (property == null) {
throw new ApiException("Missing the required parameter 'property' when calling getJsonPropertyAsString(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling getJsonPropertyAsString(Async)");
}
return getJsonPropertyAsStringCall(property, body, _callback);
}
/**
*
* Utility function to extract properties from JSON objects in language where this is cumbersome.
* @param property JSON property name or dot separated path selector such as `a.b.c` (required)
* @param body (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String getJsonPropertyAsString(String property, Object body) throws ApiException {
ApiResponse<String> localVarResp = getJsonPropertyAsStringWithHttpInfo(property, body);
return localVarResp.getData();
}
/**
*
* Utility function to extract properties from JSON objects in language where this is cumbersome.
* @param property JSON property name or dot separated path selector such as `a.b.c` (required)
* @param body (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> getJsonPropertyAsStringWithHttpInfo(String property, Object body) throws ApiException {
okhttp3.Call localVarCall = getJsonPropertyAsStringValidateBeforeCall(property, body, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Utility function to extract properties from JSON objects in language where this is cumbersome.
* @param property JSON property name or dot separated path selector such as `a.b.c` (required)
* @param body (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getJsonPropertyAsStringAsync(String property, Object body, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = getJsonPropertyAsStringValidateBeforeCall(property, body, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getUserInfo
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getUserInfoCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/user/info";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getUserInfoValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getUserInfoCall(_callback);
}
/**
*
* Get account information for your user
* @return UserInfoDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public UserInfoDto getUserInfo() throws ApiException {
ApiResponse<UserInfoDto> localVarResp = getUserInfoWithHttpInfo();
return localVarResp.getData();
}
/**
*
* Get account information for your user
* @return ApiResponse<UserInfoDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<UserInfoDto> getUserInfoWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getUserInfoValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<UserInfoDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get account information for your user
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getUserInfoAsync(final ApiCallback<UserInfoDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getUserInfoValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<UserInfoDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateTrackingPixelOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageTrackingPixelProjection;
import com.mailslurp.models.TrackingPixelDto;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class TrackingControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public TrackingControllerApi() {
this(Configuration.getDefaultApiClient());
}
public TrackingControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createTrackingPixel
* @param createTrackingPixelOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createTrackingPixelCall(CreateTrackingPixelOptions createTrackingPixelOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createTrackingPixelOptions;
// create path and map variables
String localVarPath = "/tracking/pixels";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createTrackingPixelValidateBeforeCall(CreateTrackingPixelOptions createTrackingPixelOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createTrackingPixelOptions' is set
if (createTrackingPixelOptions == null) {
throw new ApiException("Missing the required parameter 'createTrackingPixelOptions' when calling createTrackingPixel(Async)");
}
return createTrackingPixelCall(createTrackingPixelOptions, _callback);
}
/**
* Create tracking pixel
* Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
* @param createTrackingPixelOptions (required)
* @return TrackingPixelDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public TrackingPixelDto createTrackingPixel(CreateTrackingPixelOptions createTrackingPixelOptions) throws ApiException {
ApiResponse<TrackingPixelDto> localVarResp = createTrackingPixelWithHttpInfo(createTrackingPixelOptions);
return localVarResp.getData();
}
/**
* Create tracking pixel
* Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
* @param createTrackingPixelOptions (required)
* @return ApiResponse<TrackingPixelDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<TrackingPixelDto> createTrackingPixelWithHttpInfo(CreateTrackingPixelOptions createTrackingPixelOptions) throws ApiException {
okhttp3.Call localVarCall = createTrackingPixelValidateBeforeCall(createTrackingPixelOptions, null);
Type localVarReturnType = new TypeToken<TrackingPixelDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create tracking pixel (asynchronously)
* Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
* @param createTrackingPixelOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createTrackingPixelAsync(CreateTrackingPixelOptions createTrackingPixelOptions, final ApiCallback<TrackingPixelDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createTrackingPixelValidateBeforeCall(createTrackingPixelOptions, _callback);
Type localVarReturnType = new TypeToken<TrackingPixelDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAllTrackingPixels
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllTrackingPixelsCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/tracking/pixels";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllTrackingPixelsValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllTrackingPixelsCall(page, size, sort, searchFilter, since, before, _callback);
}
/**
* Get tracking pixels
* List tracking pixels in paginated form
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageTrackingPixelProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageTrackingPixelProjection getAllTrackingPixels(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageTrackingPixelProjection> localVarResp = getAllTrackingPixelsWithHttpInfo(page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* Get tracking pixels
* List tracking pixels in paginated form
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageTrackingPixelProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageTrackingPixelProjection> getAllTrackingPixelsWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllTrackingPixelsValidateBeforeCall(page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get tracking pixels (asynchronously)
* List tracking pixels in paginated form
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllTrackingPixelsAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageTrackingPixelProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllTrackingPixelsValidateBeforeCall(page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTrackingPixel
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTrackingPixelCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/tracking/pixels/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTrackingPixelValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getTrackingPixel(Async)");
}
return getTrackingPixelCall(id, _callback);
}
/**
* Get pixel
*
* @param id (required)
* @return TrackingPixelDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public TrackingPixelDto getTrackingPixel(UUID id) throws ApiException {
ApiResponse<TrackingPixelDto> localVarResp = getTrackingPixelWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get pixel
*
* @param id (required)
* @return ApiResponse<TrackingPixelDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<TrackingPixelDto> getTrackingPixelWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getTrackingPixelValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<TrackingPixelDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get pixel (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTrackingPixelAsync(UUID id, final ApiCallback<TrackingPixelDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getTrackingPixelValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<TrackingPixelDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateTemplateOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageTemplateProjection;
import com.mailslurp.models.TemplateDto;
import com.mailslurp.models.TemplatePreview;
import com.mailslurp.models.TemplateProjection;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class TemplateControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public TemplateControllerApi() {
this(Configuration.getDefaultApiClient());
}
public TemplateControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createTemplate
* @param createTemplateOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createTemplateCall(CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createTemplateOptions;
// create path and map variables
String localVarPath = "/templates";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createTemplateValidateBeforeCall(CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createTemplateOptions' is set
if (createTemplateOptions == null) {
throw new ApiException("Missing the required parameter 'createTemplateOptions' when calling createTemplate(Async)");
}
return createTemplateCall(createTemplateOptions, _callback);
}
/**
* Create a Template
* Create an email template with variables for use with templated transactional emails.
* @param createTemplateOptions (required)
* @return TemplateDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public TemplateDto createTemplate(CreateTemplateOptions createTemplateOptions) throws ApiException {
ApiResponse<TemplateDto> localVarResp = createTemplateWithHttpInfo(createTemplateOptions);
return localVarResp.getData();
}
/**
* Create a Template
* Create an email template with variables for use with templated transactional emails.
* @param createTemplateOptions (required)
* @return ApiResponse<TemplateDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplateDto> createTemplateWithHttpInfo(CreateTemplateOptions createTemplateOptions) throws ApiException {
okhttp3.Call localVarCall = createTemplateValidateBeforeCall(createTemplateOptions, null);
Type localVarReturnType = new TypeToken<TemplateDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a Template (asynchronously)
* Create an email template with variables for use with templated transactional emails.
* @param createTemplateOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createTemplateAsync(CreateTemplateOptions createTemplateOptions, final ApiCallback<TemplateDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createTemplateValidateBeforeCall(createTemplateOptions, _callback);
Type localVarReturnType = new TypeToken<TemplateDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteTemplate
* @param templateId Template ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteTemplateCall(UUID templateId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}"
.replace("{" + "templateId" + "}", localVarApiClient.escapeString(templateId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteTemplateValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling deleteTemplate(Async)");
}
return deleteTemplateCall(templateId, _callback);
}
/**
* Delete email template
* Delete template
* @param templateId Template ID (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteTemplate(UUID templateId) throws ApiException {
deleteTemplateWithHttpInfo(templateId);
}
/**
* Delete email template
* Delete template
* @param templateId Template ID (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteTemplateWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = deleteTemplateValidateBeforeCall(templateId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete email template (asynchronously)
* Delete template
* @param templateId Template ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteTemplateAsync(UUID templateId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteTemplateValidateBeforeCall(templateId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllTemplates
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllTemplatesCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/paginated";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllTemplatesValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllTemplatesCall(page, size, sort, since, before, _callback);
}
/**
* List templates
* Get all templates in paginated format
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageTemplateProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageTemplateProjection getAllTemplates(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageTemplateProjection> localVarResp = getAllTemplatesWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* List templates
* Get all templates in paginated format
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageTemplateProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageTemplateProjection> getAllTemplatesWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllTemplatesValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageTemplateProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List templates (asynchronously)
* Get all templates in paginated format
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllTemplatesAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageTemplateProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllTemplatesValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageTemplateProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplate
* @param templateId Template ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplateCall(UUID templateId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}"
.replace("{" + "templateId" + "}", localVarApiClient.escapeString(templateId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplateValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling getTemplate(Async)");
}
return getTemplateCall(templateId, _callback);
}
/**
* Get template
* Get email template
* @param templateId Template ID (required)
* @return TemplateDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public TemplateDto getTemplate(UUID templateId) throws ApiException {
ApiResponse<TemplateDto> localVarResp = getTemplateWithHttpInfo(templateId);
return localVarResp.getData();
}
/**
* Get template
* Get email template
* @param templateId Template ID (required)
* @return ApiResponse<TemplateDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplateDto> getTemplateWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = getTemplateValidateBeforeCall(templateId, null);
Type localVarReturnType = new TypeToken<TemplateDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get template (asynchronously)
* Get email template
* @param templateId Template ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplateAsync(UUID templateId, final ApiCallback<TemplateDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplateValidateBeforeCall(templateId, _callback);
Type localVarReturnType = new TypeToken<TemplateDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplatePreviewHtml
* @param templateId Template ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplatePreviewHtmlCall(UUID templateId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}/preview/html"
.replace("{" + "templateId" + "}", localVarApiClient.escapeString(templateId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"text/html;charset=utf-8",
"text/html"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplatePreviewHtmlValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling getTemplatePreviewHtml(Async)");
}
return getTemplatePreviewHtmlCall(templateId, _callback);
}
/**
* Get template preview HTML
* Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
* @param templateId Template ID (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String getTemplatePreviewHtml(UUID templateId) throws ApiException {
ApiResponse<String> localVarResp = getTemplatePreviewHtmlWithHttpInfo(templateId);
return localVarResp.getData();
}
/**
* Get template preview HTML
* Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
* @param templateId Template ID (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> getTemplatePreviewHtmlWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewHtmlValidateBeforeCall(templateId, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get template preview HTML (asynchronously)
* Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
* @param templateId Template ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplatePreviewHtmlAsync(UUID templateId, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewHtmlValidateBeforeCall(templateId, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplatePreviewJson
* @param templateId Template ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplatePreviewJsonCall(UUID templateId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}/preview/json"
.replace("{" + "templateId" + "}", localVarApiClient.escapeString(templateId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplatePreviewJsonValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling getTemplatePreviewJson(Async)");
}
return getTemplatePreviewJsonCall(templateId, _callback);
}
/**
* Get template preview Json
* Get email template preview with passed template variables in JSON format. Pass template variables as query params.
* @param templateId Template ID (required)
* @return TemplatePreview
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public TemplatePreview getTemplatePreviewJson(UUID templateId) throws ApiException {
ApiResponse<TemplatePreview> localVarResp = getTemplatePreviewJsonWithHttpInfo(templateId);
return localVarResp.getData();
}
/**
* Get template preview Json
* Get email template preview with passed template variables in JSON format. Pass template variables as query params.
* @param templateId Template ID (required)
* @return ApiResponse<TemplatePreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplatePreview> getTemplatePreviewJsonWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewJsonValidateBeforeCall(templateId, null);
Type localVarReturnType = new TypeToken<TemplatePreview>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get template preview Json (asynchronously)
* Get email template preview with passed template variables in JSON format. Pass template variables as query params.
* @param templateId Template ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplatePreviewJsonAsync(UUID templateId, final ApiCallback<TemplatePreview> _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewJsonValidateBeforeCall(templateId, _callback);
Type localVarReturnType = new TypeToken<TemplatePreview>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplates
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplatesCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplatesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getTemplatesCall(_callback);
}
/**
* List templates
* Get all templates
* @return List<TemplateProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<TemplateProjection> getTemplates() throws ApiException {
ApiResponse<List<TemplateProjection>> localVarResp = getTemplatesWithHttpInfo();
return localVarResp.getData();
}
/**
* List templates
* Get all templates
* @return ApiResponse<List<TemplateProjection>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<TemplateProjection>> getTemplatesWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTemplatesValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<TemplateProjection>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List templates (asynchronously)
* Get all templates
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getTemplatesAsync(final ApiCallback<List<TemplateProjection>> _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatesValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<TemplateProjection>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateTemplate
* @param templateId Template ID (required)
* @param createTemplateOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateTemplateCall(UUID templateId, CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createTemplateOptions;
// create path and map variables
String localVarPath = "/templates/{templateId}"
.replace("{" + "templateId" + "}", localVarApiClient.escapeString(templateId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateTemplateValidateBeforeCall(UUID templateId, CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling updateTemplate(Async)");
}
// verify the required parameter 'createTemplateOptions' is set
if (createTemplateOptions == null) {
throw new ApiException("Missing the required parameter 'createTemplateOptions' when calling updateTemplate(Async)");
}
return updateTemplateCall(templateId, createTemplateOptions, _callback);
}
/**
* Update template
* Update email template
* @param templateId Template ID (required)
* @param createTemplateOptions (required)
* @return TemplateDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public TemplateDto updateTemplate(UUID templateId, CreateTemplateOptions createTemplateOptions) throws ApiException {
ApiResponse<TemplateDto> localVarResp = updateTemplateWithHttpInfo(templateId, createTemplateOptions);
return localVarResp.getData();
}
/**
* Update template
* Update email template
* @param templateId Template ID (required)
* @param createTemplateOptions (required)
* @return ApiResponse<TemplateDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<TemplateDto> updateTemplateWithHttpInfo(UUID templateId, CreateTemplateOptions createTemplateOptions) throws ApiException {
okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, createTemplateOptions, null);
Type localVarReturnType = new TypeToken<TemplateDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update template (asynchronously)
* Update email template
* @param templateId Template ID (required)
* @param createTemplateOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateTemplateAsync(UUID templateId, CreateTemplateOptions createTemplateOptions, final ApiCallback<TemplateDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, createTemplateOptions, _callback);
Type localVarReturnType = new TypeToken<TemplateDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageSmsProjection;
import com.mailslurp.models.SmsDto;
import java.util.UUID;
import com.mailslurp.models.UnreadCount;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class SmsControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public SmsControllerApi() {
this(Configuration.getDefaultApiClient());
}
public SmsControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for deleteSmsMessage
* @param smsId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteSmsMessageCall(UUID smsId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/{smsId}"
.replace("{" + "smsId" + "}", localVarApiClient.escapeString(smsId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteSmsMessageValidateBeforeCall(UUID smsId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'smsId' is set
if (smsId == null) {
throw new ApiException("Missing the required parameter 'smsId' when calling deleteSmsMessage(Async)");
}
return deleteSmsMessageCall(smsId, _callback);
}
/**
* Delete SMS message.
* Delete an SMS message
* @param smsId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteSmsMessage(UUID smsId) throws ApiException {
deleteSmsMessageWithHttpInfo(smsId);
}
/**
* Delete SMS message.
* Delete an SMS message
* @param smsId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteSmsMessageWithHttpInfo(UUID smsId) throws ApiException {
okhttp3.Call localVarCall = deleteSmsMessageValidateBeforeCall(smsId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete SMS message. (asynchronously)
* Delete an SMS message
* @param smsId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteSmsMessageAsync(UUID smsId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteSmsMessageValidateBeforeCall(smsId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteSmsMessages
* @param phoneNumberId (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteSmsMessagesCall(UUID phoneNumberId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (phoneNumberId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("phoneNumberId", phoneNumberId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteSmsMessagesValidateBeforeCall(UUID phoneNumberId, final ApiCallback _callback) throws ApiException {
return deleteSmsMessagesCall(phoneNumberId, _callback);
}
/**
* Delete all SMS messages
* Delete all SMS messages or all messages for a given phone number
* @param phoneNumberId (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteSmsMessages(UUID phoneNumberId) throws ApiException {
deleteSmsMessagesWithHttpInfo(phoneNumberId);
}
/**
* Delete all SMS messages
* Delete all SMS messages or all messages for a given phone number
* @param phoneNumberId (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteSmsMessagesWithHttpInfo(UUID phoneNumberId) throws ApiException {
okhttp3.Call localVarCall = deleteSmsMessagesValidateBeforeCall(phoneNumberId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all SMS messages (asynchronously)
* Delete all SMS messages or all messages for a given phone number
* @param phoneNumberId (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteSmsMessagesAsync(UUID phoneNumberId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteSmsMessagesValidateBeforeCall(phoneNumberId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getSmsMessage
* @param smsId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSmsMessageCall(UUID smsId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/{smsId}"
.replace("{" + "smsId" + "}", localVarApiClient.escapeString(smsId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSmsMessageValidateBeforeCall(UUID smsId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'smsId' is set
if (smsId == null) {
throw new ApiException("Missing the required parameter 'smsId' when calling getSmsMessage(Async)");
}
return getSmsMessageCall(smsId, _callback);
}
/**
* Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController.
* Returns a SMS summary object with content.
* @param smsId (required)
* @return SmsDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SmsDto getSmsMessage(UUID smsId) throws ApiException {
ApiResponse<SmsDto> localVarResp = getSmsMessageWithHttpInfo(smsId);
return localVarResp.getData();
}
/**
* Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController.
* Returns a SMS summary object with content.
* @param smsId (required)
* @return ApiResponse<SmsDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SmsDto> getSmsMessageWithHttpInfo(UUID smsId) throws ApiException {
okhttp3.Call localVarCall = getSmsMessageValidateBeforeCall(smsId, null);
Type localVarReturnType = new TypeToken<SmsDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController. (asynchronously)
* Returns a SMS summary object with content.
* @param smsId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSmsMessageAsync(UUID smsId, final ApiCallback<SmsDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getSmsMessageValidateBeforeCall(smsId, _callback);
Type localVarReturnType = new TypeToken<SmsDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSmsMessagesPaginated
* @param phoneNumber Optional receiving phone number to filter SMS messages for (optional)
* @param page Optional page index in SMS list pagination (optional, default to 0)
* @param size Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param since Optional filter SMSs received after given date time (optional)
* @param before Optional filter SMSs received before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSmsMessagesPaginatedCall(UUID phoneNumber, Integer page, Integer size, String sort, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (phoneNumber != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("phoneNumber", phoneNumber));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSmsMessagesPaginatedValidateBeforeCall(UUID phoneNumber, Integer page, Integer size, String sort, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getSmsMessagesPaginatedCall(phoneNumber, page, size, sort, unreadOnly, since, before, _callback);
}
/**
* Get all SMS messages in all phone numbers in paginated form. .
* By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages
* @param phoneNumber Optional receiving phone number to filter SMS messages for (optional)
* @param page Optional page index in SMS list pagination (optional, default to 0)
* @param size Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param since Optional filter SMSs received after given date time (optional)
* @param before Optional filter SMSs received before given date time (optional)
* @return PageSmsProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageSmsProjection getSmsMessagesPaginated(UUID phoneNumber, Integer page, Integer size, String sort, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageSmsProjection> localVarResp = getSmsMessagesPaginatedWithHttpInfo(phoneNumber, page, size, sort, unreadOnly, since, before);
return localVarResp.getData();
}
/**
* Get all SMS messages in all phone numbers in paginated form. .
* By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages
* @param phoneNumber Optional receiving phone number to filter SMS messages for (optional)
* @param page Optional page index in SMS list pagination (optional, default to 0)
* @param size Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param since Optional filter SMSs received after given date time (optional)
* @param before Optional filter SMSs received before given date time (optional)
* @return ApiResponse<PageSmsProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageSmsProjection> getSmsMessagesPaginatedWithHttpInfo(UUID phoneNumber, Integer page, Integer size, String sort, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSmsMessagesPaginatedValidateBeforeCall(phoneNumber, page, size, sort, unreadOnly, since, before, null);
Type localVarReturnType = new TypeToken<PageSmsProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all SMS messages in all phone numbers in paginated form. . (asynchronously)
* By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages
* @param phoneNumber Optional receiving phone number to filter SMS messages for (optional)
* @param page Optional page index in SMS list pagination (optional, default to 0)
* @param size Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param since Optional filter SMSs received after given date time (optional)
* @param before Optional filter SMSs received before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSmsMessagesPaginatedAsync(UUID phoneNumber, Integer page, Integer size, String sort, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageSmsProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getSmsMessagesPaginatedValidateBeforeCall(phoneNumber, page, size, sort, unreadOnly, since, before, _callback);
Type localVarReturnType = new TypeToken<PageSmsProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getUnreadSmsCount
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getUnreadSmsCountCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/unreadCount";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getUnreadSmsCountValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getUnreadSmsCountCall(_callback);
}
/**
* Get unread SMS count
* Get number of SMS unread. Unread means has not been viewed in dashboard or returned in an email API response
* @return UnreadCount
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public UnreadCount getUnreadSmsCount() throws ApiException {
ApiResponse<UnreadCount> localVarResp = getUnreadSmsCountWithHttpInfo();
return localVarResp.getData();
}
/**
* Get unread SMS count
* Get number of SMS unread. Unread means has not been viewed in dashboard or returned in an email API response
* @return ApiResponse<UnreadCount>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<UnreadCount> getUnreadSmsCountWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getUnreadSmsCountValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<UnreadCount>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get unread SMS count (asynchronously)
* Get number of SMS unread. Unread means has not been viewed in dashboard or returned in an email API response
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getUnreadSmsCountAsync(final ApiCallback<UnreadCount> _callback) throws ApiException {
okhttp3.Call localVarCall = getUnreadSmsCountValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<UnreadCount>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.DeliveryStatusDto;
import com.mailslurp.models.EmailPreviewUrls;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageDeliveryStatus;
import com.mailslurp.models.PageSentEmailProjection;
import com.mailslurp.models.PageSentEmailWithQueueProjection;
import com.mailslurp.models.PageTrackingPixelProjection;
import com.mailslurp.models.RawEmailJson;
import com.mailslurp.models.SentEmailDto;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class SentEmailsControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public SentEmailsControllerApi() {
this(Configuration.getDefaultApiClient());
}
public SentEmailsControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for deleteAllSentEmails
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllSentEmailsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAllSentEmailsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return deleteAllSentEmailsCall(_callback);
}
/**
* Delete all sent email receipts
*
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAllSentEmails() throws ApiException {
deleteAllSentEmailsWithHttpInfo();
}
/**
* Delete all sent email receipts
*
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAllSentEmailsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = deleteAllSentEmailsValidateBeforeCall(null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all sent email receipts (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllSentEmailsAsync(final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAllSentEmailsValidateBeforeCall(_callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteSentEmail
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteSentEmailCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteSentEmailValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteSentEmail(Async)");
}
return deleteSentEmailCall(id, _callback);
}
/**
* Delete sent email receipt
*
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteSentEmail(UUID id) throws ApiException {
deleteSentEmailWithHttpInfo(id);
}
/**
* Delete sent email receipt
*
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteSentEmailWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = deleteSentEmailValidateBeforeCall(id, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete sent email receipt (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteSentEmailAsync(UUID id, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteSentEmailValidateBeforeCall(id, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllSentTrackingPixels
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllSentTrackingPixelsCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/tracking-pixels";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllSentTrackingPixelsValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllSentTrackingPixelsCall(page, size, sort, searchFilter, since, before, _callback);
}
/**
*
* Get all sent email tracking pixels in paginated form
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageTrackingPixelProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageTrackingPixelProjection getAllSentTrackingPixels(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageTrackingPixelProjection> localVarResp = getAllSentTrackingPixelsWithHttpInfo(page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
*
* Get all sent email tracking pixels in paginated form
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageTrackingPixelProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageTrackingPixelProjection> getAllSentTrackingPixelsWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllSentTrackingPixelsValidateBeforeCall(page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get all sent email tracking pixels in paginated form
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllSentTrackingPixelsAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageTrackingPixelProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllSentTrackingPixelsValidateBeforeCall(page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getRawSentEmailContents
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawSentEmailContentsCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{emailId}/raw"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getRawSentEmailContentsValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getRawSentEmailContents(Async)");
}
return getRawSentEmailContentsCall(emailId, _callback);
}
/**
* Get raw sent email string. Returns unparsed raw SMTP message with headers and body.
* Returns a raw, unparsed, and unprocessed sent email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawSentEmailJson endpoint
* @param emailId ID of email (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String getRawSentEmailContents(UUID emailId) throws ApiException {
ApiResponse<String> localVarResp = getRawSentEmailContentsWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get raw sent email string. Returns unparsed raw SMTP message with headers and body.
* Returns a raw, unparsed, and unprocessed sent email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawSentEmailJson endpoint
* @param emailId ID of email (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> getRawSentEmailContentsWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getRawSentEmailContentsValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get raw sent email string. Returns unparsed raw SMTP message with headers and body. (asynchronously)
* Returns a raw, unparsed, and unprocessed sent email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawSentEmailJson endpoint
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawSentEmailContentsAsync(UUID emailId, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = getRawSentEmailContentsValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getRawSentEmailJson
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawSentEmailJsonCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{emailId}/raw/json"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getRawSentEmailJsonValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getRawSentEmailJson(Async)");
}
return getRawSentEmailJsonCall(emailId, _callback);
}
/**
* Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format.
* Returns a raw, unparsed, and unprocessed sent email wrapped in a JSON response object for easier handling when compared with the getRawSentEmail text/plain response
* @param emailId ID of email (required)
* @return RawEmailJson
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public RawEmailJson getRawSentEmailJson(UUID emailId) throws ApiException {
ApiResponse<RawEmailJson> localVarResp = getRawSentEmailJsonWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format.
* Returns a raw, unparsed, and unprocessed sent email wrapped in a JSON response object for easier handling when compared with the getRawSentEmail text/plain response
* @param emailId ID of email (required)
* @return ApiResponse<RawEmailJson>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<RawEmailJson> getRawSentEmailJsonWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getRawSentEmailJsonValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<RawEmailJson>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get raw sent email in JSON. Unparsed SMTP message in JSON wrapper format. (asynchronously)
* Returns a raw, unparsed, and unprocessed sent email wrapped in a JSON response object for easier handling when compared with the getRawSentEmail text/plain response
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawSentEmailJsonAsync(UUID emailId, final ApiCallback<RawEmailJson> _callback) throws ApiException {
okhttp3.Call localVarCall = getRawSentEmailJsonValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<RawEmailJson>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentDeliveryStatus
* @param deliveryId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentDeliveryStatusCall(UUID deliveryId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/delivery-status/{deliveryId}"
.replace("{" + "deliveryId" + "}", localVarApiClient.escapeString(deliveryId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentDeliveryStatusValidateBeforeCall(UUID deliveryId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'deliveryId' is set
if (deliveryId == null) {
throw new ApiException("Missing the required parameter 'deliveryId' when calling getSentDeliveryStatus(Async)");
}
return getSentDeliveryStatusCall(deliveryId, _callback);
}
/**
*
* Get a sent email delivery status
* @param deliveryId (required)
* @return DeliveryStatusDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DeliveryStatusDto getSentDeliveryStatus(UUID deliveryId) throws ApiException {
ApiResponse<DeliveryStatusDto> localVarResp = getSentDeliveryStatusWithHttpInfo(deliveryId);
return localVarResp.getData();
}
/**
*
* Get a sent email delivery status
* @param deliveryId (required)
* @return ApiResponse<DeliveryStatusDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DeliveryStatusDto> getSentDeliveryStatusWithHttpInfo(UUID deliveryId) throws ApiException {
okhttp3.Call localVarCall = getSentDeliveryStatusValidateBeforeCall(deliveryId, null);
Type localVarReturnType = new TypeToken<DeliveryStatusDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get a sent email delivery status
* @param deliveryId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentDeliveryStatusAsync(UUID deliveryId, final ApiCallback<DeliveryStatusDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentDeliveryStatusValidateBeforeCall(deliveryId, _callback);
Type localVarReturnType = new TypeToken<DeliveryStatusDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentDeliveryStatuses
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentDeliveryStatusesCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/delivery-status";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentDeliveryStatusesValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getSentDeliveryStatusesCall(page, size, sort, since, before, _callback);
}
/**
*
* Get all sent email delivery statuses
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageDeliveryStatus
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageDeliveryStatus getSentDeliveryStatuses(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageDeliveryStatus> localVarResp = getSentDeliveryStatusesWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
*
* Get all sent email delivery statuses
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageDeliveryStatus>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageDeliveryStatus> getSentDeliveryStatusesWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSentDeliveryStatusesValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageDeliveryStatus>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get all sent email delivery statuses
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentDeliveryStatusesAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageDeliveryStatus> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentDeliveryStatusesValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageDeliveryStatus>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentDeliveryStatusesBySentId
* @param sentId ID of the sent email that you want to get the delivery status of. Sent email object is returned when sending an email (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentDeliveryStatusesBySentIdCall(UUID sentId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{sentId}/delivery-status"
.replace("{" + "sentId" + "}", localVarApiClient.escapeString(sentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentDeliveryStatusesBySentIdValidateBeforeCall(UUID sentId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sentId' is set
if (sentId == null) {
throw new ApiException("Missing the required parameter 'sentId' when calling getSentDeliveryStatusesBySentId(Async)");
}
return getSentDeliveryStatusesBySentIdCall(sentId, page, size, sort, since, before, _callback);
}
/**
*
* Get all sent email delivery statuses
* @param sentId ID of the sent email that you want to get the delivery status of. Sent email object is returned when sending an email (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageDeliveryStatus
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageDeliveryStatus getSentDeliveryStatusesBySentId(UUID sentId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageDeliveryStatus> localVarResp = getSentDeliveryStatusesBySentIdWithHttpInfo(sentId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
*
* Get all sent email delivery statuses
* @param sentId ID of the sent email that you want to get the delivery status of. Sent email object is returned when sending an email (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageDeliveryStatus>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageDeliveryStatus> getSentDeliveryStatusesBySentIdWithHttpInfo(UUID sentId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSentDeliveryStatusesBySentIdValidateBeforeCall(sentId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageDeliveryStatus>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get all sent email delivery statuses
* @param sentId ID of the sent email that you want to get the delivery status of. Sent email object is returned when sending an email (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentDeliveryStatusesBySentIdAsync(UUID sentId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageDeliveryStatus> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentDeliveryStatusesBySentIdValidateBeforeCall(sentId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageDeliveryStatus>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentEmail
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentEmailValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getSentEmail(Async)");
}
return getSentEmailCall(id, _callback);
}
/**
* Get sent email receipt
*
* @param id (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SentEmailDto getSentEmail(UUID id) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = getSentEmailWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get sent email receipt
*
* @param id (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> getSentEmailWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getSentEmailValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get sent email receipt (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailAsync(UUID id, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentEmailValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentEmailHTMLContent
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailHTMLContentCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{id}/html"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"text/html"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentEmailHTMLContentValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getSentEmailHTMLContent(Async)");
}
return getSentEmailHTMLContentCall(id, _callback);
}
/**
* Get sent email HTML content
*
* @param id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String getSentEmailHTMLContent(UUID id) throws ApiException {
ApiResponse<String> localVarResp = getSentEmailHTMLContentWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get sent email HTML content
*
* @param id (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> getSentEmailHTMLContentWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getSentEmailHTMLContentValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get sent email HTML content (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailHTMLContentAsync(UUID id, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentEmailHTMLContentValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentEmailPreviewURLs
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailPreviewURLsCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{id}/urls"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentEmailPreviewURLsValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getSentEmailPreviewURLs(Async)");
}
return getSentEmailPreviewURLsCall(id, _callback);
}
/**
* Get sent email URL for viewing in browser or downloading
* Get a list of URLs for sent email content as text/html or raw SMTP message for viewing the message in a browser.
* @param id (required)
* @return EmailPreviewUrls
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailPreviewUrls getSentEmailPreviewURLs(UUID id) throws ApiException {
ApiResponse<EmailPreviewUrls> localVarResp = getSentEmailPreviewURLsWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get sent email URL for viewing in browser or downloading
* Get a list of URLs for sent email content as text/html or raw SMTP message for viewing the message in a browser.
* @param id (required)
* @return ApiResponse<EmailPreviewUrls>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailPreviewUrls> getSentEmailPreviewURLsWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getSentEmailPreviewURLsValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<EmailPreviewUrls>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get sent email URL for viewing in browser or downloading (asynchronously)
* Get a list of URLs for sent email content as text/html or raw SMTP message for viewing the message in a browser.
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailPreviewURLsAsync(UUID id, final ApiCallback<EmailPreviewUrls> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentEmailPreviewURLsValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<EmailPreviewUrls>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentEmailTrackingPixels
* @param id (required)
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailTrackingPixelsCall(UUID id, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/{id}/tracking-pixels"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentEmailTrackingPixelsValidateBeforeCall(UUID id, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getSentEmailTrackingPixels(Async)");
}
return getSentEmailTrackingPixelsCall(id, page, size, sort, searchFilter, since, before, _callback);
}
/**
*
* Get all tracking pixels for a sent email in paginated form
* @param id (required)
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageTrackingPixelProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageTrackingPixelProjection getSentEmailTrackingPixels(UUID id, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageTrackingPixelProjection> localVarResp = getSentEmailTrackingPixelsWithHttpInfo(id, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
*
* Get all tracking pixels for a sent email in paginated form
* @param id (required)
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageTrackingPixelProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageTrackingPixelProjection> getSentEmailTrackingPixelsWithHttpInfo(UUID id, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSentEmailTrackingPixelsValidateBeforeCall(id, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get all tracking pixels for a sent email in paginated form
* @param id (required)
* @param page Optional page index in sent email tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in sent email tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailTrackingPixelsAsync(UUID id, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageTrackingPixelProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentEmailTrackingPixelsValidateBeforeCall(id, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentEmails
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailsCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentEmailsValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getSentEmailsCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* Get all sent emails in paginated form
*
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageSentEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageSentEmailProjection getSentEmails(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageSentEmailProjection> localVarResp = getSentEmailsWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* Get all sent emails in paginated form
*
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageSentEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageSentEmailProjection> getSentEmailsWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSentEmailsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageSentEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all sent emails in paginated form (asynchronously)
*
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailsAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageSentEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentEmailsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageSentEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentEmailsWithQueueResults
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailsWithQueueResultsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/queue-results";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentEmailsWithQueueResultsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getSentEmailsWithQueueResultsCall(page, size, sort, since, before, _callback);
}
/**
* Get results of email sent with queues in paginated form
*
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageSentEmailWithQueueProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageSentEmailWithQueueProjection getSentEmailsWithQueueResults(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageSentEmailWithQueueProjection> localVarResp = getSentEmailsWithQueueResultsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get results of email sent with queues in paginated form
*
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageSentEmailWithQueueProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageSentEmailWithQueueProjection> getSentEmailsWithQueueResultsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSentEmailsWithQueueResultsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageSentEmailWithQueueProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get results of email sent with queues in paginated form (asynchronously)
*
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentEmailsWithQueueResultsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageSentEmailWithQueueProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentEmailsWithQueueResultsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageSentEmailWithQueueProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSentOrganizationEmails
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in sent email list pagination (optional, default to 0)
* @param size Optional page size in sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentOrganizationEmailsCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/organization";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSentOrganizationEmailsValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getSentOrganizationEmailsCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
*
* Get all sent organization emails in paginated form
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in sent email list pagination (optional, default to 0)
* @param size Optional page size in sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageSentEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageSentEmailProjection getSentOrganizationEmails(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageSentEmailProjection> localVarResp = getSentOrganizationEmailsWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
*
* Get all sent organization emails in paginated form
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in sent email list pagination (optional, default to 0)
* @param size Optional page size in sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageSentEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageSentEmailProjection> getSentOrganizationEmailsWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getSentOrganizationEmailsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageSentEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get all sent organization emails in paginated form
* @param inboxId Optional inboxId to filter sender of sent emails by (optional)
* @param page Optional page index in sent email list pagination (optional, default to 0)
* @param size Optional page size in sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSentOrganizationEmailsAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageSentEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getSentOrganizationEmailsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageSentEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for waitForDeliveryStatuses
* @param sentId Optional sent email ID filter (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param index Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForDeliveryStatusesCall(UUID sentId, UUID inboxId, Long timeout, Integer index, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sent/delivery-status/wait-for";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (sentId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sentId", sentId));
}
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (index != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("index", index));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForDeliveryStatusesValidateBeforeCall(UUID sentId, UUID inboxId, Long timeout, Integer index, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return waitForDeliveryStatusesCall(sentId, inboxId, timeout, index, since, before, _callback);
}
/**
*
* Wait for delivery statuses
* @param sentId Optional sent email ID filter (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param index Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return DeliveryStatusDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DeliveryStatusDto waitForDeliveryStatuses(UUID sentId, UUID inboxId, Long timeout, Integer index, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<DeliveryStatusDto> localVarResp = waitForDeliveryStatusesWithHttpInfo(sentId, inboxId, timeout, index, since, before);
return localVarResp.getData();
}
/**
*
* Wait for delivery statuses
* @param sentId Optional sent email ID filter (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param index Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<DeliveryStatusDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DeliveryStatusDto> waitForDeliveryStatusesWithHttpInfo(UUID sentId, UUID inboxId, Long timeout, Integer index, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = waitForDeliveryStatusesValidateBeforeCall(sentId, inboxId, timeout, index, since, before, null);
Type localVarReturnType = new TypeToken<DeliveryStatusDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Wait for delivery statuses
* @param sentId Optional sent email ID filter (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param index Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1 (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForDeliveryStatusesAsync(UUID sentId, UUID inboxId, Long timeout, Integer index, OffsetDateTime since, OffsetDateTime before, final ApiCallback<DeliveryStatusDto> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForDeliveryStatusesValidateBeforeCall(sentId, inboxId, timeout, index, since, before, _callback);
Type localVarReturnType = new TypeToken<DeliveryStatusDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateEmergencyAddressOptions;
import com.mailslurp.models.EmergencyAddress;
import com.mailslurp.models.EmergencyAddressDto;
import com.mailslurp.models.EmptyResponseDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PagePhoneNumberProjection;
import com.mailslurp.models.PhoneNumberDto;
import com.mailslurp.models.PhonePlanDto;
import com.mailslurp.models.TestPhoneNumberOptions;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class PhoneControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public PhoneControllerApi() {
this(Configuration.getDefaultApiClient());
}
public PhoneControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createEmergencyAddress
* @param createEmergencyAddressOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createEmergencyAddressCall(CreateEmergencyAddressOptions createEmergencyAddressOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createEmergencyAddressOptions;
// create path and map variables
String localVarPath = "/phone/emergency-addresses";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createEmergencyAddressValidateBeforeCall(CreateEmergencyAddressOptions createEmergencyAddressOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createEmergencyAddressOptions' is set
if (createEmergencyAddressOptions == null) {
throw new ApiException("Missing the required parameter 'createEmergencyAddressOptions' when calling createEmergencyAddress(Async)");
}
return createEmergencyAddressCall(createEmergencyAddressOptions, _callback);
}
/**
*
*
* @param createEmergencyAddressOptions (required)
* @return EmergencyAddress
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmergencyAddress createEmergencyAddress(CreateEmergencyAddressOptions createEmergencyAddressOptions) throws ApiException {
ApiResponse<EmergencyAddress> localVarResp = createEmergencyAddressWithHttpInfo(createEmergencyAddressOptions);
return localVarResp.getData();
}
/**
*
*
* @param createEmergencyAddressOptions (required)
* @return ApiResponse<EmergencyAddress>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmergencyAddress> createEmergencyAddressWithHttpInfo(CreateEmergencyAddressOptions createEmergencyAddressOptions) throws ApiException {
okhttp3.Call localVarCall = createEmergencyAddressValidateBeforeCall(createEmergencyAddressOptions, null);
Type localVarReturnType = new TypeToken<EmergencyAddress>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param createEmergencyAddressOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createEmergencyAddressAsync(CreateEmergencyAddressOptions createEmergencyAddressOptions, final ApiCallback<EmergencyAddress> _callback) throws ApiException {
okhttp3.Call localVarCall = createEmergencyAddressValidateBeforeCall(createEmergencyAddressOptions, _callback);
Type localVarReturnType = new TypeToken<EmergencyAddress>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteEmergencyAddress
* @param addressId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteEmergencyAddressCall(UUID addressId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/emergency-addresses/{addressId}"
.replace("{" + "addressId" + "}", localVarApiClient.escapeString(addressId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteEmergencyAddressValidateBeforeCall(UUID addressId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'addressId' is set
if (addressId == null) {
throw new ApiException("Missing the required parameter 'addressId' when calling deleteEmergencyAddress(Async)");
}
return deleteEmergencyAddressCall(addressId, _callback);
}
/**
*
*
* @param addressId (required)
* @return EmptyResponseDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmptyResponseDto deleteEmergencyAddress(UUID addressId) throws ApiException {
ApiResponse<EmptyResponseDto> localVarResp = deleteEmergencyAddressWithHttpInfo(addressId);
return localVarResp.getData();
}
/**
*
*
* @param addressId (required)
* @return ApiResponse<EmptyResponseDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmptyResponseDto> deleteEmergencyAddressWithHttpInfo(UUID addressId) throws ApiException {
okhttp3.Call localVarCall = deleteEmergencyAddressValidateBeforeCall(addressId, null);
Type localVarReturnType = new TypeToken<EmptyResponseDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param addressId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteEmergencyAddressAsync(UUID addressId, final ApiCallback<EmptyResponseDto> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteEmergencyAddressValidateBeforeCall(addressId, _callback);
Type localVarReturnType = new TypeToken<EmptyResponseDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deletePhoneNumber
* @param phoneNumberId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deletePhoneNumberCall(UUID phoneNumberId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/numbers/{phoneNumberId}"
.replace("{" + "phoneNumberId" + "}", localVarApiClient.escapeString(phoneNumberId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deletePhoneNumberValidateBeforeCall(UUID phoneNumberId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'phoneNumberId' is set
if (phoneNumberId == null) {
throw new ApiException("Missing the required parameter 'phoneNumberId' when calling deletePhoneNumber(Async)");
}
return deletePhoneNumberCall(phoneNumberId, _callback);
}
/**
*
*
* @param phoneNumberId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deletePhoneNumber(UUID phoneNumberId) throws ApiException {
deletePhoneNumberWithHttpInfo(phoneNumberId);
}
/**
*
*
* @param phoneNumberId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deletePhoneNumberWithHttpInfo(UUID phoneNumberId) throws ApiException {
okhttp3.Call localVarCall = deletePhoneNumberValidateBeforeCall(phoneNumberId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
*
* @param phoneNumberId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deletePhoneNumberAsync(UUID phoneNumberId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deletePhoneNumberValidateBeforeCall(phoneNumberId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getEmergencyAddress
* @param addressId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmergencyAddressCall(UUID addressId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/emergency-addresses/{addressId}"
.replace("{" + "addressId" + "}", localVarApiClient.escapeString(addressId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmergencyAddressValidateBeforeCall(UUID addressId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'addressId' is set
if (addressId == null) {
throw new ApiException("Missing the required parameter 'addressId' when calling getEmergencyAddress(Async)");
}
return getEmergencyAddressCall(addressId, _callback);
}
/**
*
*
* @param addressId (required)
* @return EmergencyAddress
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmergencyAddress getEmergencyAddress(UUID addressId) throws ApiException {
ApiResponse<EmergencyAddress> localVarResp = getEmergencyAddressWithHttpInfo(addressId);
return localVarResp.getData();
}
/**
*
*
* @param addressId (required)
* @return ApiResponse<EmergencyAddress>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmergencyAddress> getEmergencyAddressWithHttpInfo(UUID addressId) throws ApiException {
okhttp3.Call localVarCall = getEmergencyAddressValidateBeforeCall(addressId, null);
Type localVarReturnType = new TypeToken<EmergencyAddress>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param addressId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmergencyAddressAsync(UUID addressId, final ApiCallback<EmergencyAddress> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmergencyAddressValidateBeforeCall(addressId, _callback);
Type localVarReturnType = new TypeToken<EmergencyAddress>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmergencyAddresses
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmergencyAddressesCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/emergency-addresses";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmergencyAddressesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getEmergencyAddressesCall(_callback);
}
/**
*
*
* @return List<EmergencyAddressDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<EmergencyAddressDto> getEmergencyAddresses() throws ApiException {
ApiResponse<List<EmergencyAddressDto>> localVarResp = getEmergencyAddressesWithHttpInfo();
return localVarResp.getData();
}
/**
*
*
* @return ApiResponse<List<EmergencyAddressDto>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<EmergencyAddressDto>> getEmergencyAddressesWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getEmergencyAddressesValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<EmergencyAddressDto>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmergencyAddressesAsync(final ApiCallback<List<EmergencyAddressDto>> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmergencyAddressesValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<EmergencyAddressDto>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPhoneNumber
* @param phoneNumberId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhoneNumberCall(UUID phoneNumberId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/numbers/{phoneNumberId}"
.replace("{" + "phoneNumberId" + "}", localVarApiClient.escapeString(phoneNumberId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getPhoneNumberValidateBeforeCall(UUID phoneNumberId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'phoneNumberId' is set
if (phoneNumberId == null) {
throw new ApiException("Missing the required parameter 'phoneNumberId' when calling getPhoneNumber(Async)");
}
return getPhoneNumberCall(phoneNumberId, _callback);
}
/**
*
*
* @param phoneNumberId (required)
* @return PhoneNumberDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PhoneNumberDto getPhoneNumber(UUID phoneNumberId) throws ApiException {
ApiResponse<PhoneNumberDto> localVarResp = getPhoneNumberWithHttpInfo(phoneNumberId);
return localVarResp.getData();
}
/**
*
*
* @param phoneNumberId (required)
* @return ApiResponse<PhoneNumberDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PhoneNumberDto> getPhoneNumberWithHttpInfo(UUID phoneNumberId) throws ApiException {
okhttp3.Call localVarCall = getPhoneNumberValidateBeforeCall(phoneNumberId, null);
Type localVarReturnType = new TypeToken<PhoneNumberDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param phoneNumberId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhoneNumberAsync(UUID phoneNumberId, final ApiCallback<PhoneNumberDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getPhoneNumberValidateBeforeCall(phoneNumberId, _callback);
Type localVarReturnType = new TypeToken<PhoneNumberDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPhoneNumbers
* @param phoneCountry Optional phone country (optional)
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhoneNumbersCall(String phoneCountry, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/numbers";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (phoneCountry != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("phoneCountry", phoneCountry));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getPhoneNumbersValidateBeforeCall(String phoneCountry, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getPhoneNumbersCall(phoneCountry, page, size, sort, since, before, _callback);
}
/**
*
*
* @param phoneCountry Optional phone country (optional)
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PagePhoneNumberProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PagePhoneNumberProjection getPhoneNumbers(String phoneCountry, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PagePhoneNumberProjection> localVarResp = getPhoneNumbersWithHttpInfo(phoneCountry, page, size, sort, since, before);
return localVarResp.getData();
}
/**
*
*
* @param phoneCountry Optional phone country (optional)
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PagePhoneNumberProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PagePhoneNumberProjection> getPhoneNumbersWithHttpInfo(String phoneCountry, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getPhoneNumbersValidateBeforeCall(phoneCountry, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PagePhoneNumberProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param phoneCountry Optional phone country (optional)
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhoneNumbersAsync(String phoneCountry, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PagePhoneNumberProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getPhoneNumbersValidateBeforeCall(phoneCountry, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PagePhoneNumberProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPhonePlans
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhonePlansCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/phone/plans";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getPhonePlansValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getPhonePlansCall(_callback);
}
/**
*
*
* @return List<PhonePlanDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<PhonePlanDto> getPhonePlans() throws ApiException {
ApiResponse<List<PhonePlanDto>> localVarResp = getPhonePlansWithHttpInfo();
return localVarResp.getData();
}
/**
*
*
* @return ApiResponse<List<PhonePlanDto>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<PhonePlanDto>> getPhonePlansWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getPhonePlansValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<PhonePlanDto>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPhonePlansAsync(final ApiCallback<List<PhonePlanDto>> _callback) throws ApiException {
okhttp3.Call localVarCall = getPhonePlansValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<PhonePlanDto>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testPhoneNumberSendSms
* @param phoneNumberId (required)
* @param testPhoneNumberOptions (required)
* @param xTestId (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testPhoneNumberSendSmsCall(UUID phoneNumberId, TestPhoneNumberOptions testPhoneNumberOptions, String xTestId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = testPhoneNumberOptions;
// create path and map variables
String localVarPath = "/phone/numbers/{phoneNumberId}/test"
.replace("{" + "phoneNumberId" + "}", localVarApiClient.escapeString(phoneNumberId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (xTestId != null) {
localVarHeaderParams.put("x-test-id", localVarApiClient.parameterToString(xTestId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testPhoneNumberSendSmsValidateBeforeCall(UUID phoneNumberId, TestPhoneNumberOptions testPhoneNumberOptions, String xTestId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'phoneNumberId' is set
if (phoneNumberId == null) {
throw new ApiException("Missing the required parameter 'phoneNumberId' when calling testPhoneNumberSendSms(Async)");
}
// verify the required parameter 'testPhoneNumberOptions' is set
if (testPhoneNumberOptions == null) {
throw new ApiException("Missing the required parameter 'testPhoneNumberOptions' when calling testPhoneNumberSendSms(Async)");
}
return testPhoneNumberSendSmsCall(phoneNumberId, testPhoneNumberOptions, xTestId, _callback);
}
/**
*
*
* @param phoneNumberId (required)
* @param testPhoneNumberOptions (required)
* @param xTestId (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public void testPhoneNumberSendSms(UUID phoneNumberId, TestPhoneNumberOptions testPhoneNumberOptions, String xTestId) throws ApiException {
testPhoneNumberSendSmsWithHttpInfo(phoneNumberId, testPhoneNumberOptions, xTestId);
}
/**
*
*
* @param phoneNumberId (required)
* @param testPhoneNumberOptions (required)
* @param xTestId (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> testPhoneNumberSendSmsWithHttpInfo(UUID phoneNumberId, TestPhoneNumberOptions testPhoneNumberOptions, String xTestId) throws ApiException {
okhttp3.Call localVarCall = testPhoneNumberSendSmsValidateBeforeCall(phoneNumberId, testPhoneNumberOptions, xTestId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
*
* @param phoneNumberId (required)
* @param testPhoneNumberOptions (required)
* @param xTestId (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testPhoneNumberSendSmsAsync(UUID phoneNumberId, TestPhoneNumberOptions testPhoneNumberOptions, String xTestId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = testPhoneNumberSendSmsValidateBeforeCall(phoneNumberId, testPhoneNumberOptions, xTestId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.MissedEmailDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageMissedEmailProjection;
import com.mailslurp.models.PageUnknownMissedEmailProjection;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class MissedEmailControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public MissedEmailControllerApi() {
this(Configuration.getDefaultApiClient());
}
public MissedEmailControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for getAllMissedEmails
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllMissedEmailsCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/missed-emails";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllMissedEmailsValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId, final ApiCallback _callback) throws ApiException {
return getAllMissedEmailsCall(page, size, sort, searchFilter, since, before, inboxId, _callback);
}
/**
* Get all MissedEmails in paginated format
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @return PageMissedEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageMissedEmailProjection getAllMissedEmails(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId) throws ApiException {
ApiResponse<PageMissedEmailProjection> localVarResp = getAllMissedEmailsWithHttpInfo(page, size, sort, searchFilter, since, before, inboxId);
return localVarResp.getData();
}
/**
* Get all MissedEmails in paginated format
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @return ApiResponse<PageMissedEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageMissedEmailProjection> getAllMissedEmailsWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getAllMissedEmailsValidateBeforeCall(page, size, sort, searchFilter, since, before, inboxId, null);
Type localVarReturnType = new TypeToken<PageMissedEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all MissedEmails in paginated format (asynchronously)
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllMissedEmailsAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId, final ApiCallback<PageMissedEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllMissedEmailsValidateBeforeCall(page, size, sort, searchFilter, since, before, inboxId, _callback);
Type localVarReturnType = new TypeToken<PageMissedEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAllUnknownMissedEmails
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllUnknownMissedEmailsCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/missed-emails/unknown";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllUnknownMissedEmailsValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId, final ApiCallback _callback) throws ApiException {
return getAllUnknownMissedEmailsCall(page, size, sort, searchFilter, since, before, inboxId, _callback);
}
/**
* Get all unknown missed emails in paginated format
* Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @return PageUnknownMissedEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageUnknownMissedEmailProjection getAllUnknownMissedEmails(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId) throws ApiException {
ApiResponse<PageUnknownMissedEmailProjection> localVarResp = getAllUnknownMissedEmailsWithHttpInfo(page, size, sort, searchFilter, since, before, inboxId);
return localVarResp.getData();
}
/**
* Get all unknown missed emails in paginated format
* Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @return ApiResponse<PageUnknownMissedEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageUnknownMissedEmailProjection> getAllUnknownMissedEmailsWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getAllUnknownMissedEmailsValidateBeforeCall(page, size, sort, searchFilter, since, before, inboxId, null);
Type localVarReturnType = new TypeToken<PageUnknownMissedEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all unknown missed emails in paginated format (asynchronously)
* Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param inboxId Optional inbox ID filter (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllUnknownMissedEmailsAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, UUID inboxId, final ApiCallback<PageUnknownMissedEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllUnknownMissedEmailsValidateBeforeCall(page, size, sort, searchFilter, since, before, inboxId, _callback);
Type localVarReturnType = new TypeToken<PageUnknownMissedEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getMissedEmail
* @param missedEmailId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getMissedEmailCall(UUID missedEmailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/missed-emails/{missedEmailId}"
.replace("{" + "missedEmailId" + "}", localVarApiClient.escapeString(missedEmailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getMissedEmailValidateBeforeCall(UUID missedEmailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'missedEmailId' is set
if (missedEmailId == null) {
throw new ApiException("Missing the required parameter 'missedEmailId' when calling getMissedEmail(Async)");
}
return getMissedEmailCall(missedEmailId, _callback);
}
/**
* Get MissedEmail
* List emails that were missed due to plan limits.
* @param missedEmailId (required)
* @return MissedEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public MissedEmailDto getMissedEmail(UUID missedEmailId) throws ApiException {
ApiResponse<MissedEmailDto> localVarResp = getMissedEmailWithHttpInfo(missedEmailId);
return localVarResp.getData();
}
/**
* Get MissedEmail
* List emails that were missed due to plan limits.
* @param missedEmailId (required)
* @return ApiResponse<MissedEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<MissedEmailDto> getMissedEmailWithHttpInfo(UUID missedEmailId) throws ApiException {
okhttp3.Call localVarCall = getMissedEmailValidateBeforeCall(missedEmailId, null);
Type localVarReturnType = new TypeToken<MissedEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get MissedEmail (asynchronously)
* List emails that were missed due to plan limits.
* @param missedEmailId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getMissedEmailAsync(UUID missedEmailId, final ApiCallback<MissedEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getMissedEmailValidateBeforeCall(missedEmailId, _callback);
Type localVarReturnType = new TypeToken<MissedEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for restoreMissedEmails
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call restoreMissedEmailsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/missed-emails/restore";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call restoreMissedEmailsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return restoreMissedEmailsCall(_callback);
}
/**
* Restore missed emails
* If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method.
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public void restoreMissedEmails() throws ApiException {
restoreMissedEmailsWithHttpInfo();
}
/**
* Restore missed emails
* If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method.
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> restoreMissedEmailsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = restoreMissedEmailsValidateBeforeCall(null);
return localVarApiClient.execute(localVarCall);
}
/**
* Restore missed emails (asynchronously)
* If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method.
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call restoreMissedEmailsAsync(final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = restoreMissedEmailsValidateBeforeCall(_callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for waitForNthMissedEmail
* @param index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 (required)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForNthMissedEmailCall(Integer index, UUID inboxId, Long timeout, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/missed-emails/waitForNthMissedEmail";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (timeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeout", timeout));
}
if (index != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("index", index));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call waitForNthMissedEmailValidateBeforeCall(Integer index, UUID inboxId, Long timeout, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'index' is set
if (index == null) {
throw new ApiException("Missing the required parameter 'index' when calling waitForNthMissedEmail(Async)");
}
return waitForNthMissedEmailCall(index, inboxId, timeout, since, before, _callback);
}
/**
* Wait for Nth missed email
* Wait for 0 based index missed email
* @param index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 (required)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return MissedEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public MissedEmailDto waitForNthMissedEmail(Integer index, UUID inboxId, Long timeout, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<MissedEmailDto> localVarResp = waitForNthMissedEmailWithHttpInfo(index, inboxId, timeout, since, before);
return localVarResp.getData();
}
/**
* Wait for Nth missed email
* Wait for 0 based index missed email
* @param index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 (required)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<MissedEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<MissedEmailDto> waitForNthMissedEmailWithHttpInfo(Integer index, UUID inboxId, Long timeout, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = waitForNthMissedEmailValidateBeforeCall(index, inboxId, timeout, since, before, null);
Type localVarReturnType = new TypeToken<MissedEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Wait for Nth missed email (asynchronously)
* Wait for 0 based index missed email
* @param index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1 (required)
* @param inboxId Optional inbox ID filter (optional)
* @param timeout Optional timeout milliseconds (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call waitForNthMissedEmailAsync(Integer index, UUID inboxId, Long timeout, OffsetDateTime since, OffsetDateTime before, final ApiCallback<MissedEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = waitForNthMissedEmailValidateBeforeCall(index, inboxId, timeout, since, before, _callback);
Type localVarReturnType = new TypeToken<MissedEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.DNSLookupOptions;
import com.mailslurp.models.DNSLookupResults;
import com.mailslurp.models.DescribeDomainOptions;
import com.mailslurp.models.DescribeMailServerDomainResult;
import com.mailslurp.models.EmailVerificationResult;
import com.mailslurp.models.IPAddressResult;
import com.mailslurp.models.VerifyEmailAddressOptions;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class MailServerControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public MailServerControllerApi() {
this(Configuration.getDefaultApiClient());
}
public MailServerControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for describeMailServerDomain
* @param describeDomainOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call describeMailServerDomainCall(DescribeDomainOptions describeDomainOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = describeDomainOptions;
// create path and map variables
String localVarPath = "/mail-server/describe/domain";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call describeMailServerDomainValidateBeforeCall(DescribeDomainOptions describeDomainOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'describeDomainOptions' is set
if (describeDomainOptions == null) {
throw new ApiException("Missing the required parameter 'describeDomainOptions' when calling describeMailServerDomain(Async)");
}
return describeMailServerDomainCall(describeDomainOptions, _callback);
}
/**
* Get DNS Mail Server records for a domain
*
* @param describeDomainOptions (required)
* @return DescribeMailServerDomainResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DescribeMailServerDomainResult describeMailServerDomain(DescribeDomainOptions describeDomainOptions) throws ApiException {
ApiResponse<DescribeMailServerDomainResult> localVarResp = describeMailServerDomainWithHttpInfo(describeDomainOptions);
return localVarResp.getData();
}
/**
* Get DNS Mail Server records for a domain
*
* @param describeDomainOptions (required)
* @return ApiResponse<DescribeMailServerDomainResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DescribeMailServerDomainResult> describeMailServerDomainWithHttpInfo(DescribeDomainOptions describeDomainOptions) throws ApiException {
okhttp3.Call localVarCall = describeMailServerDomainValidateBeforeCall(describeDomainOptions, null);
Type localVarReturnType = new TypeToken<DescribeMailServerDomainResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get DNS Mail Server records for a domain (asynchronously)
*
* @param describeDomainOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call describeMailServerDomainAsync(DescribeDomainOptions describeDomainOptions, final ApiCallback<DescribeMailServerDomainResult> _callback) throws ApiException {
okhttp3.Call localVarCall = describeMailServerDomainValidateBeforeCall(describeDomainOptions, _callback);
Type localVarReturnType = new TypeToken<DescribeMailServerDomainResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getDnsLookup
* @param dnSLookupOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDnsLookupCall(DNSLookupOptions dnSLookupOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = dnSLookupOptions;
// create path and map variables
String localVarPath = "/mail-server/describe/dns-lookup";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDnsLookupValidateBeforeCall(DNSLookupOptions dnSLookupOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'dnSLookupOptions' is set
if (dnSLookupOptions == null) {
throw new ApiException("Missing the required parameter 'dnSLookupOptions' when calling getDnsLookup(Async)");
}
return getDnsLookupCall(dnSLookupOptions, _callback);
}
/**
* Lookup DNS records for a domain
*
* @param dnSLookupOptions (required)
* @return DNSLookupResults
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DNSLookupResults getDnsLookup(DNSLookupOptions dnSLookupOptions) throws ApiException {
ApiResponse<DNSLookupResults> localVarResp = getDnsLookupWithHttpInfo(dnSLookupOptions);
return localVarResp.getData();
}
/**
* Lookup DNS records for a domain
*
* @param dnSLookupOptions (required)
* @return ApiResponse<DNSLookupResults>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DNSLookupResults> getDnsLookupWithHttpInfo(DNSLookupOptions dnSLookupOptions) throws ApiException {
okhttp3.Call localVarCall = getDnsLookupValidateBeforeCall(dnSLookupOptions, null);
Type localVarReturnType = new TypeToken<DNSLookupResults>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Lookup DNS records for a domain (asynchronously)
*
* @param dnSLookupOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDnsLookupAsync(DNSLookupOptions dnSLookupOptions, final ApiCallback<DNSLookupResults> _callback) throws ApiException {
okhttp3.Call localVarCall = getDnsLookupValidateBeforeCall(dnSLookupOptions, _callback);
Type localVarReturnType = new TypeToken<DNSLookupResults>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getIpAddress
* @param name (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getIpAddressCall(String name, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/mail-server/describe/ip-address";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getIpAddressValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling getIpAddress(Async)");
}
return getIpAddressCall(name, _callback);
}
/**
* Get IP address for a domain
*
* @param name (required)
* @return IPAddressResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public IPAddressResult getIpAddress(String name) throws ApiException {
ApiResponse<IPAddressResult> localVarResp = getIpAddressWithHttpInfo(name);
return localVarResp.getData();
}
/**
* Get IP address for a domain
*
* @param name (required)
* @return ApiResponse<IPAddressResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<IPAddressResult> getIpAddressWithHttpInfo(String name) throws ApiException {
okhttp3.Call localVarCall = getIpAddressValidateBeforeCall(name, null);
Type localVarReturnType = new TypeToken<IPAddressResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get IP address for a domain (asynchronously)
*
* @param name (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getIpAddressAsync(String name, final ApiCallback<IPAddressResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getIpAddressValidateBeforeCall(name, _callback);
Type localVarReturnType = new TypeToken<IPAddressResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for verifyEmailAddress
* @param verifyEmailAddressOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public okhttp3.Call verifyEmailAddressCall(VerifyEmailAddressOptions verifyEmailAddressOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = verifyEmailAddressOptions;
// create path and map variables
String localVarPath = "/mail-server/verify/email-address";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call verifyEmailAddressValidateBeforeCall(VerifyEmailAddressOptions verifyEmailAddressOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'verifyEmailAddressOptions' is set
if (verifyEmailAddressOptions == null) {
throw new ApiException("Missing the required parameter 'verifyEmailAddressOptions' when calling verifyEmailAddress(Async)");
}
return verifyEmailAddressCall(verifyEmailAddressOptions, _callback);
}
/**
* Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server.
*
* @param verifyEmailAddressOptions (required)
* @return EmailVerificationResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public EmailVerificationResult verifyEmailAddress(VerifyEmailAddressOptions verifyEmailAddressOptions) throws ApiException {
ApiResponse<EmailVerificationResult> localVarResp = verifyEmailAddressWithHttpInfo(verifyEmailAddressOptions);
return localVarResp.getData();
}
/**
* Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server.
*
* @param verifyEmailAddressOptions (required)
* @return ApiResponse<EmailVerificationResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public ApiResponse<EmailVerificationResult> verifyEmailAddressWithHttpInfo(VerifyEmailAddressOptions verifyEmailAddressOptions) throws ApiException {
okhttp3.Call localVarCall = verifyEmailAddressValidateBeforeCall(verifyEmailAddressOptions, null);
Type localVarReturnType = new TypeToken<EmailVerificationResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Deprecated. Use the EmailVerificationController methods for more accurate and reliable functionality. Verify the existence of an email address at a given mail server. (asynchronously)
*
* @param verifyEmailAddressOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public okhttp3.Call verifyEmailAddressAsync(VerifyEmailAddressOptions verifyEmailAddressOptions, final ApiCallback<EmailVerificationResult> _callback) throws ApiException {
okhttp3.Call localVarCall = verifyEmailAddressValidateBeforeCall(verifyEmailAddressOptions, _callback);
Type localVarReturnType = new TypeToken<EmailVerificationResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateInboxRulesetOptions;
import com.mailslurp.models.InboxRulesetDto;
import com.mailslurp.models.InboxRulesetTestOptions;
import com.mailslurp.models.InboxRulesetTestResult;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageInboxRulesetDto;
import com.mailslurp.models.TestNewInboxRulesetOptions;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class InboxRulesetControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public InboxRulesetControllerApi() {
this(Configuration.getDefaultApiClient());
}
public InboxRulesetControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createNewInboxRuleset
* @param createInboxRulesetOptions (required)
* @param inboxId Inbox id to attach ruleset to (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewInboxRulesetCall(CreateInboxRulesetOptions createInboxRulesetOptions, UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createInboxRulesetOptions;
// create path and map variables
String localVarPath = "/rulesets";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createNewInboxRulesetValidateBeforeCall(CreateInboxRulesetOptions createInboxRulesetOptions, UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createInboxRulesetOptions' is set
if (createInboxRulesetOptions == null) {
throw new ApiException("Missing the required parameter 'createInboxRulesetOptions' when calling createNewInboxRuleset(Async)");
}
return createNewInboxRulesetCall(createInboxRulesetOptions, inboxId, _callback);
}
/**
* Create an inbox ruleset
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param createInboxRulesetOptions (required)
* @param inboxId Inbox id to attach ruleset to (optional)
* @return InboxRulesetDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxRulesetDto createNewInboxRuleset(CreateInboxRulesetOptions createInboxRulesetOptions, UUID inboxId) throws ApiException {
ApiResponse<InboxRulesetDto> localVarResp = createNewInboxRulesetWithHttpInfo(createInboxRulesetOptions, inboxId);
return localVarResp.getData();
}
/**
* Create an inbox ruleset
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param createInboxRulesetOptions (required)
* @param inboxId Inbox id to attach ruleset to (optional)
* @return ApiResponse<InboxRulesetDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxRulesetDto> createNewInboxRulesetWithHttpInfo(CreateInboxRulesetOptions createInboxRulesetOptions, UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = createNewInboxRulesetValidateBeforeCall(createInboxRulesetOptions, inboxId, null);
Type localVarReturnType = new TypeToken<InboxRulesetDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox ruleset (asynchronously)
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param createInboxRulesetOptions (required)
* @param inboxId Inbox id to attach ruleset to (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewInboxRulesetAsync(CreateInboxRulesetOptions createInboxRulesetOptions, UUID inboxId, final ApiCallback<InboxRulesetDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createNewInboxRulesetValidateBeforeCall(createInboxRulesetOptions, inboxId, _callback);
Type localVarReturnType = new TypeToken<InboxRulesetDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteInboxRuleset
* @param id ID of inbox ruleset (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxRulesetCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/rulesets/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxRulesetValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteInboxRuleset(Async)");
}
return deleteInboxRulesetCall(id, _callback);
}
/**
* Delete an inbox ruleset
* Delete inbox ruleset
* @param id ID of inbox ruleset (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInboxRuleset(UUID id) throws ApiException {
deleteInboxRulesetWithHttpInfo(id);
}
/**
* Delete an inbox ruleset
* Delete inbox ruleset
* @param id ID of inbox ruleset (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxRulesetWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = deleteInboxRulesetValidateBeforeCall(id, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an inbox ruleset (asynchronously)
* Delete inbox ruleset
* @param id ID of inbox ruleset (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxRulesetAsync(UUID id, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxRulesetValidateBeforeCall(id, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteInboxRulesets
* @param inboxId Optional inbox id to attach ruleset to (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxRulesetsCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/rulesets";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxRulesetsValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
return deleteInboxRulesetsCall(inboxId, _callback);
}
/**
* Delete inbox rulesets
* Delete inbox rulesets. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach ruleset to (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInboxRulesets(UUID inboxId) throws ApiException {
deleteInboxRulesetsWithHttpInfo(inboxId);
}
/**
* Delete inbox rulesets
* Delete inbox rulesets. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach ruleset to (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxRulesetsWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = deleteInboxRulesetsValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete inbox rulesets (asynchronously)
* Delete inbox rulesets. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach ruleset to (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxRulesetsAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxRulesetsValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getInboxRuleset
* @param id ID of inbox ruleset (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxRulesetCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/rulesets/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxRulesetValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getInboxRuleset(Async)");
}
return getInboxRulesetCall(id, _callback);
}
/**
* Get an inbox ruleset
* Get inbox ruleset
* @param id ID of inbox ruleset (required)
* @return InboxRulesetDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxRulesetDto getInboxRuleset(UUID id) throws ApiException {
ApiResponse<InboxRulesetDto> localVarResp = getInboxRulesetWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get an inbox ruleset
* Get inbox ruleset
* @param id ID of inbox ruleset (required)
* @return ApiResponse<InboxRulesetDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxRulesetDto> getInboxRulesetWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getInboxRulesetValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<InboxRulesetDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox ruleset (asynchronously)
* Get inbox ruleset
* @param id ID of inbox ruleset (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxRulesetAsync(UUID id, final ApiCallback<InboxRulesetDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxRulesetValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<InboxRulesetDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxRulesets
* @param inboxId Optional inbox id to get rulesets from (optional)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxRulesetsCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/rulesets";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxRulesetsValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getInboxRulesetsCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* List inbox rulesets
* List all rulesets attached to an inbox
* @param inboxId Optional inbox id to get rulesets from (optional)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageInboxRulesetDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxRulesetDto getInboxRulesets(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageInboxRulesetDto> localVarResp = getInboxRulesetsWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* List inbox rulesets
* List all rulesets attached to an inbox
* @param inboxId Optional inbox id to get rulesets from (optional)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageInboxRulesetDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxRulesetDto> getInboxRulesetsWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxRulesetsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageInboxRulesetDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List inbox rulesets (asynchronously)
* List all rulesets attached to an inbox
* @param inboxId Optional inbox id to get rulesets from (optional)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxRulesetsAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageInboxRulesetDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxRulesetsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageInboxRulesetDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testInboxRuleset
* @param id ID of inbox ruleset (required)
* @param inboxRulesetTestOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxRulesetCall(UUID id, InboxRulesetTestOptions inboxRulesetTestOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = inboxRulesetTestOptions;
// create path and map variables
String localVarPath = "/rulesets/{id}/test"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testInboxRulesetValidateBeforeCall(UUID id, InboxRulesetTestOptions inboxRulesetTestOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling testInboxRuleset(Async)");
}
// verify the required parameter 'inboxRulesetTestOptions' is set
if (inboxRulesetTestOptions == null) {
throw new ApiException("Missing the required parameter 'inboxRulesetTestOptions' when calling testInboxRuleset(Async)");
}
return testInboxRulesetCall(id, inboxRulesetTestOptions, _callback);
}
/**
* Test an inbox ruleset
* Test an inbox ruleset
* @param id ID of inbox ruleset (required)
* @param inboxRulesetTestOptions (required)
* @return InboxRulesetTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxRulesetTestResult testInboxRuleset(UUID id, InboxRulesetTestOptions inboxRulesetTestOptions) throws ApiException {
ApiResponse<InboxRulesetTestResult> localVarResp = testInboxRulesetWithHttpInfo(id, inboxRulesetTestOptions);
return localVarResp.getData();
}
/**
* Test an inbox ruleset
* Test an inbox ruleset
* @param id ID of inbox ruleset (required)
* @param inboxRulesetTestOptions (required)
* @return ApiResponse<InboxRulesetTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxRulesetTestResult> testInboxRulesetWithHttpInfo(UUID id, InboxRulesetTestOptions inboxRulesetTestOptions) throws ApiException {
okhttp3.Call localVarCall = testInboxRulesetValidateBeforeCall(id, inboxRulesetTestOptions, null);
Type localVarReturnType = new TypeToken<InboxRulesetTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test an inbox ruleset (asynchronously)
* Test an inbox ruleset
* @param id ID of inbox ruleset (required)
* @param inboxRulesetTestOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxRulesetAsync(UUID id, InboxRulesetTestOptions inboxRulesetTestOptions, final ApiCallback<InboxRulesetTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = testInboxRulesetValidateBeforeCall(id, inboxRulesetTestOptions, _callback);
Type localVarReturnType = new TypeToken<InboxRulesetTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testInboxRulesetsForInbox
* @param inboxId ID of inbox (required)
* @param inboxRulesetTestOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxRulesetsForInboxCall(UUID inboxId, InboxRulesetTestOptions inboxRulesetTestOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = inboxRulesetTestOptions;
// create path and map variables
String localVarPath = "/rulesets";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testInboxRulesetsForInboxValidateBeforeCall(UUID inboxId, InboxRulesetTestOptions inboxRulesetTestOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling testInboxRulesetsForInbox(Async)");
}
// verify the required parameter 'inboxRulesetTestOptions' is set
if (inboxRulesetTestOptions == null) {
throw new ApiException("Missing the required parameter 'inboxRulesetTestOptions' when calling testInboxRulesetsForInbox(Async)");
}
return testInboxRulesetsForInboxCall(inboxId, inboxRulesetTestOptions, _callback);
}
/**
* Test inbox rulesets for inbox
* Test inbox rulesets for inbox
* @param inboxId ID of inbox (required)
* @param inboxRulesetTestOptions (required)
* @return InboxRulesetTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxRulesetTestResult testInboxRulesetsForInbox(UUID inboxId, InboxRulesetTestOptions inboxRulesetTestOptions) throws ApiException {
ApiResponse<InboxRulesetTestResult> localVarResp = testInboxRulesetsForInboxWithHttpInfo(inboxId, inboxRulesetTestOptions);
return localVarResp.getData();
}
/**
* Test inbox rulesets for inbox
* Test inbox rulesets for inbox
* @param inboxId ID of inbox (required)
* @param inboxRulesetTestOptions (required)
* @return ApiResponse<InboxRulesetTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxRulesetTestResult> testInboxRulesetsForInboxWithHttpInfo(UUID inboxId, InboxRulesetTestOptions inboxRulesetTestOptions) throws ApiException {
okhttp3.Call localVarCall = testInboxRulesetsForInboxValidateBeforeCall(inboxId, inboxRulesetTestOptions, null);
Type localVarReturnType = new TypeToken<InboxRulesetTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test inbox rulesets for inbox (asynchronously)
* Test inbox rulesets for inbox
* @param inboxId ID of inbox (required)
* @param inboxRulesetTestOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxRulesetsForInboxAsync(UUID inboxId, InboxRulesetTestOptions inboxRulesetTestOptions, final ApiCallback<InboxRulesetTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = testInboxRulesetsForInboxValidateBeforeCall(inboxId, inboxRulesetTestOptions, _callback);
Type localVarReturnType = new TypeToken<InboxRulesetTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testNewInboxRuleset
* @param testNewInboxRulesetOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testNewInboxRulesetCall(TestNewInboxRulesetOptions testNewInboxRulesetOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = testNewInboxRulesetOptions;
// create path and map variables
String localVarPath = "/rulesets";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testNewInboxRulesetValidateBeforeCall(TestNewInboxRulesetOptions testNewInboxRulesetOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'testNewInboxRulesetOptions' is set
if (testNewInboxRulesetOptions == null) {
throw new ApiException("Missing the required parameter 'testNewInboxRulesetOptions' when calling testNewInboxRuleset(Async)");
}
return testNewInboxRulesetCall(testNewInboxRulesetOptions, _callback);
}
/**
* Test new inbox ruleset
* Test new inbox ruleset
* @param testNewInboxRulesetOptions (required)
* @return InboxRulesetTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxRulesetTestResult testNewInboxRuleset(TestNewInboxRulesetOptions testNewInboxRulesetOptions) throws ApiException {
ApiResponse<InboxRulesetTestResult> localVarResp = testNewInboxRulesetWithHttpInfo(testNewInboxRulesetOptions);
return localVarResp.getData();
}
/**
* Test new inbox ruleset
* Test new inbox ruleset
* @param testNewInboxRulesetOptions (required)
* @return ApiResponse<InboxRulesetTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxRulesetTestResult> testNewInboxRulesetWithHttpInfo(TestNewInboxRulesetOptions testNewInboxRulesetOptions) throws ApiException {
okhttp3.Call localVarCall = testNewInboxRulesetValidateBeforeCall(testNewInboxRulesetOptions, null);
Type localVarReturnType = new TypeToken<InboxRulesetTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test new inbox ruleset (asynchronously)
* Test new inbox ruleset
* @param testNewInboxRulesetOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testNewInboxRulesetAsync(TestNewInboxRulesetOptions testNewInboxRulesetOptions, final ApiCallback<InboxRulesetTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = testNewInboxRulesetValidateBeforeCall(testNewInboxRulesetOptions, _callback);
Type localVarReturnType = new TypeToken<InboxRulesetTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateInboxReplierOptions;
import com.mailslurp.models.InboxReplierDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageInboxReplierDto;
import com.mailslurp.models.PageInboxReplierEvents;
import java.util.UUID;
import com.mailslurp.models.UpdateInboxReplierOptions;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class InboxReplierControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public InboxReplierControllerApi() {
this(Configuration.getDefaultApiClient());
}
public InboxReplierControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createNewInboxReplier
* @param createInboxReplierOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewInboxReplierCall(CreateInboxReplierOptions createInboxReplierOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createInboxReplierOptions;
// create path and map variables
String localVarPath = "/repliers";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createNewInboxReplierValidateBeforeCall(CreateInboxReplierOptions createInboxReplierOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createInboxReplierOptions' is set
if (createInboxReplierOptions == null) {
throw new ApiException("Missing the required parameter 'createInboxReplierOptions' when calling createNewInboxReplier(Async)");
}
return createNewInboxReplierCall(createInboxReplierOptions, _callback);
}
/**
* Create an inbox replier
* Create a new inbox rule for reply toing, blocking, and allowing emails when sending and receiving
* @param createInboxReplierOptions (required)
* @return InboxReplierDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxReplierDto createNewInboxReplier(CreateInboxReplierOptions createInboxReplierOptions) throws ApiException {
ApiResponse<InboxReplierDto> localVarResp = createNewInboxReplierWithHttpInfo(createInboxReplierOptions);
return localVarResp.getData();
}
/**
* Create an inbox replier
* Create a new inbox rule for reply toing, blocking, and allowing emails when sending and receiving
* @param createInboxReplierOptions (required)
* @return ApiResponse<InboxReplierDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxReplierDto> createNewInboxReplierWithHttpInfo(CreateInboxReplierOptions createInboxReplierOptions) throws ApiException {
okhttp3.Call localVarCall = createNewInboxReplierValidateBeforeCall(createInboxReplierOptions, null);
Type localVarReturnType = new TypeToken<InboxReplierDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox replier (asynchronously)
* Create a new inbox rule for reply toing, blocking, and allowing emails when sending and receiving
* @param createInboxReplierOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewInboxReplierAsync(CreateInboxReplierOptions createInboxReplierOptions, final ApiCallback<InboxReplierDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createNewInboxReplierValidateBeforeCall(createInboxReplierOptions, _callback);
Type localVarReturnType = new TypeToken<InboxReplierDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteInboxReplier
* @param id ID of inbox replier (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxReplierCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/repliers/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxReplierValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteInboxReplier(Async)");
}
return deleteInboxReplierCall(id, _callback);
}
/**
* Delete an inbox replier
* Delete inbox replier
* @param id ID of inbox replier (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInboxReplier(UUID id) throws ApiException {
deleteInboxReplierWithHttpInfo(id);
}
/**
* Delete an inbox replier
* Delete inbox replier
* @param id ID of inbox replier (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxReplierWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = deleteInboxReplierValidateBeforeCall(id, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an inbox replier (asynchronously)
* Delete inbox replier
* @param id ID of inbox replier (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxReplierAsync(UUID id, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxReplierValidateBeforeCall(id, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteInboxRepliers
* @param inboxId Optional inbox id to attach replier to (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxRepliersCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/repliers";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxRepliersValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
return deleteInboxRepliersCall(inboxId, _callback);
}
/**
* Delete inbox repliers
* Delete inbox repliers. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach replier to (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInboxRepliers(UUID inboxId) throws ApiException {
deleteInboxRepliersWithHttpInfo(inboxId);
}
/**
* Delete inbox repliers
* Delete inbox repliers. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach replier to (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxRepliersWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = deleteInboxRepliersValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete inbox repliers (asynchronously)
* Delete inbox repliers. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach replier to (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxRepliersAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxRepliersValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getInboxReplier
* @param id ID of inbox replier (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxReplierCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/repliers/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxReplierValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getInboxReplier(Async)");
}
return getInboxReplierCall(id, _callback);
}
/**
* Get an inbox replier
* Get inbox ruleset
* @param id ID of inbox replier (required)
* @return InboxReplierDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxReplierDto getInboxReplier(UUID id) throws ApiException {
ApiResponse<InboxReplierDto> localVarResp = getInboxReplierWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get an inbox replier
* Get inbox ruleset
* @param id ID of inbox replier (required)
* @return ApiResponse<InboxReplierDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxReplierDto> getInboxReplierWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getInboxReplierValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<InboxReplierDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox replier (asynchronously)
* Get inbox ruleset
* @param id ID of inbox replier (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxReplierAsync(UUID id, final ApiCallback<InboxReplierDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxReplierValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<InboxReplierDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxReplierEvents
* @param id ID of inbox replier (required)
* @param page Optional page index in inbox replier event list pagination (optional, default to 0)
* @param size Optional page size in inbox replier event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxReplierEventsCall(UUID id, Integer page, Integer size, String sort, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/repliers/{id}/events"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxReplierEventsValidateBeforeCall(UUID id, Integer page, Integer size, String sort, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getInboxReplierEvents(Async)");
}
return getInboxReplierEventsCall(id, page, size, sort, _callback);
}
/**
* Get an inbox replier event list
* Get inbox ruleset events
* @param id ID of inbox replier (required)
* @param page Optional page index in inbox replier event list pagination (optional, default to 0)
* @param size Optional page size in inbox replier event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @return PageInboxReplierEvents
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxReplierEvents getInboxReplierEvents(UUID id, Integer page, Integer size, String sort) throws ApiException {
ApiResponse<PageInboxReplierEvents> localVarResp = getInboxReplierEventsWithHttpInfo(id, page, size, sort);
return localVarResp.getData();
}
/**
* Get an inbox replier event list
* Get inbox ruleset events
* @param id ID of inbox replier (required)
* @param page Optional page index in inbox replier event list pagination (optional, default to 0)
* @param size Optional page size in inbox replier event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @return ApiResponse<PageInboxReplierEvents>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxReplierEvents> getInboxReplierEventsWithHttpInfo(UUID id, Integer page, Integer size, String sort) throws ApiException {
okhttp3.Call localVarCall = getInboxReplierEventsValidateBeforeCall(id, page, size, sort, null);
Type localVarReturnType = new TypeToken<PageInboxReplierEvents>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox replier event list (asynchronously)
* Get inbox ruleset events
* @param id ID of inbox replier (required)
* @param page Optional page index in inbox replier event list pagination (optional, default to 0)
* @param size Optional page size in inbox replier event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxReplierEventsAsync(UUID id, Integer page, Integer size, String sort, final ApiCallback<PageInboxReplierEvents> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxReplierEventsValidateBeforeCall(id, page, size, sort, _callback);
Type localVarReturnType = new TypeToken<PageInboxReplierEvents>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxRepliers
* @param inboxId Optional inbox id to get repliers from (optional)
* @param page Optional page index in inbox replier list pagination (optional, default to 0)
* @param size Optional page size in inbox replier list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxRepliersCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/repliers";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxRepliersValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getInboxRepliersCall(inboxId, page, size, sort, since, before, _callback);
}
/**
* List inbox repliers
* List all repliers attached to an inbox
* @param inboxId Optional inbox id to get repliers from (optional)
* @param page Optional page index in inbox replier list pagination (optional, default to 0)
* @param size Optional page size in inbox replier list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageInboxReplierDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxReplierDto getInboxRepliers(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageInboxReplierDto> localVarResp = getInboxRepliersWithHttpInfo(inboxId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* List inbox repliers
* List all repliers attached to an inbox
* @param inboxId Optional inbox id to get repliers from (optional)
* @param page Optional page index in inbox replier list pagination (optional, default to 0)
* @param size Optional page size in inbox replier list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageInboxReplierDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxReplierDto> getInboxRepliersWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxRepliersValidateBeforeCall(inboxId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageInboxReplierDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List inbox repliers (asynchronously)
* List all repliers attached to an inbox
* @param inboxId Optional inbox id to get repliers from (optional)
* @param page Optional page index in inbox replier list pagination (optional, default to 0)
* @param size Optional page size in inbox replier list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxRepliersAsync(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageInboxReplierDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxRepliersValidateBeforeCall(inboxId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageInboxReplierDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateInboxReplier
* @param id ID of inbox replier (required)
* @param updateInboxReplierOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateInboxReplierCall(UUID id, UpdateInboxReplierOptions updateInboxReplierOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateInboxReplierOptions;
// create path and map variables
String localVarPath = "/repliers/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateInboxReplierValidateBeforeCall(UUID id, UpdateInboxReplierOptions updateInboxReplierOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling updateInboxReplier(Async)");
}
// verify the required parameter 'updateInboxReplierOptions' is set
if (updateInboxReplierOptions == null) {
throw new ApiException("Missing the required parameter 'updateInboxReplierOptions' when calling updateInboxReplier(Async)");
}
return updateInboxReplierCall(id, updateInboxReplierOptions, _callback);
}
/**
* Update an inbox replier
* Update inbox ruleset
* @param id ID of inbox replier (required)
* @param updateInboxReplierOptions (required)
* @return InboxReplierDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxReplierDto updateInboxReplier(UUID id, UpdateInboxReplierOptions updateInboxReplierOptions) throws ApiException {
ApiResponse<InboxReplierDto> localVarResp = updateInboxReplierWithHttpInfo(id, updateInboxReplierOptions);
return localVarResp.getData();
}
/**
* Update an inbox replier
* Update inbox ruleset
* @param id ID of inbox replier (required)
* @param updateInboxReplierOptions (required)
* @return ApiResponse<InboxReplierDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxReplierDto> updateInboxReplierWithHttpInfo(UUID id, UpdateInboxReplierOptions updateInboxReplierOptions) throws ApiException {
okhttp3.Call localVarCall = updateInboxReplierValidateBeforeCall(id, updateInboxReplierOptions, null);
Type localVarReturnType = new TypeToken<InboxReplierDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update an inbox replier (asynchronously)
* Update inbox ruleset
* @param id ID of inbox replier (required)
* @param updateInboxReplierOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateInboxReplierAsync(UUID id, UpdateInboxReplierOptions updateInboxReplierOptions, final ApiCallback<InboxReplierDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateInboxReplierValidateBeforeCall(id, updateInboxReplierOptions, _callback);
Type localVarReturnType = new TypeToken<InboxReplierDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateInboxForwarderOptions;
import com.mailslurp.models.InboxForwarderDto;
import com.mailslurp.models.InboxForwarderTestOptions;
import com.mailslurp.models.InboxForwarderTestResult;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageInboxForwarderDto;
import com.mailslurp.models.PageInboxForwarderEvents;
import com.mailslurp.models.TestNewInboxForwarderOptions;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class InboxForwarderControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public InboxForwarderControllerApi() {
this(Configuration.getDefaultApiClient());
}
public InboxForwarderControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createNewInboxForwarder
* @param inboxId Inbox id to attach forwarder to (required)
* @param createInboxForwarderOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewInboxForwarderCall(UUID inboxId, CreateInboxForwarderOptions createInboxForwarderOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createInboxForwarderOptions;
// create path and map variables
String localVarPath = "/forwarders";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createNewInboxForwarderValidateBeforeCall(UUID inboxId, CreateInboxForwarderOptions createInboxForwarderOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling createNewInboxForwarder(Async)");
}
// verify the required parameter 'createInboxForwarderOptions' is set
if (createInboxForwarderOptions == null) {
throw new ApiException("Missing the required parameter 'createInboxForwarderOptions' when calling createNewInboxForwarder(Async)");
}
return createNewInboxForwarderCall(inboxId, createInboxForwarderOptions, _callback);
}
/**
* Create an inbox forwarder
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param inboxId Inbox id to attach forwarder to (required)
* @param createInboxForwarderOptions (required)
* @return InboxForwarderDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxForwarderDto createNewInboxForwarder(UUID inboxId, CreateInboxForwarderOptions createInboxForwarderOptions) throws ApiException {
ApiResponse<InboxForwarderDto> localVarResp = createNewInboxForwarderWithHttpInfo(inboxId, createInboxForwarderOptions);
return localVarResp.getData();
}
/**
* Create an inbox forwarder
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param inboxId Inbox id to attach forwarder to (required)
* @param createInboxForwarderOptions (required)
* @return ApiResponse<InboxForwarderDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxForwarderDto> createNewInboxForwarderWithHttpInfo(UUID inboxId, CreateInboxForwarderOptions createInboxForwarderOptions) throws ApiException {
okhttp3.Call localVarCall = createNewInboxForwarderValidateBeforeCall(inboxId, createInboxForwarderOptions, null);
Type localVarReturnType = new TypeToken<InboxForwarderDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox forwarder (asynchronously)
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param inboxId Inbox id to attach forwarder to (required)
* @param createInboxForwarderOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewInboxForwarderAsync(UUID inboxId, CreateInboxForwarderOptions createInboxForwarderOptions, final ApiCallback<InboxForwarderDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createNewInboxForwarderValidateBeforeCall(inboxId, createInboxForwarderOptions, _callback);
Type localVarReturnType = new TypeToken<InboxForwarderDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteInboxForwarder
* @param id ID of inbox forwarder (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxForwarderCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forwarders/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxForwarderValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteInboxForwarder(Async)");
}
return deleteInboxForwarderCall(id, _callback);
}
/**
* Delete an inbox forwarder
* Delete inbox forwarder
* @param id ID of inbox forwarder (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInboxForwarder(UUID id) throws ApiException {
deleteInboxForwarderWithHttpInfo(id);
}
/**
* Delete an inbox forwarder
* Delete inbox forwarder
* @param id ID of inbox forwarder (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxForwarderWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = deleteInboxForwarderValidateBeforeCall(id, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an inbox forwarder (asynchronously)
* Delete inbox forwarder
* @param id ID of inbox forwarder (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxForwarderAsync(UUID id, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxForwarderValidateBeforeCall(id, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteInboxForwarders
* @param inboxId Optional inbox id to attach forwarder to (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxForwardersCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forwarders";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxForwardersValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
return deleteInboxForwardersCall(inboxId, _callback);
}
/**
* Delete inbox forwarders
* Delete inbox forwarders. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach forwarder to (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInboxForwarders(UUID inboxId) throws ApiException {
deleteInboxForwardersWithHttpInfo(inboxId);
}
/**
* Delete inbox forwarders
* Delete inbox forwarders. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach forwarder to (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxForwardersWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = deleteInboxForwardersValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete inbox forwarders (asynchronously)
* Delete inbox forwarders. Accepts optional inboxId filter.
* @param inboxId Optional inbox id to attach forwarder to (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxForwardersAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxForwardersValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getInboxForwarder
* @param id ID of inbox forwarder (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxForwarderCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forwarders/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxForwarderValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getInboxForwarder(Async)");
}
return getInboxForwarderCall(id, _callback);
}
/**
* Get an inbox forwarder
* Get inbox ruleset
* @param id ID of inbox forwarder (required)
* @return InboxForwarderDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxForwarderDto getInboxForwarder(UUID id) throws ApiException {
ApiResponse<InboxForwarderDto> localVarResp = getInboxForwarderWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get an inbox forwarder
* Get inbox ruleset
* @param id ID of inbox forwarder (required)
* @return ApiResponse<InboxForwarderDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxForwarderDto> getInboxForwarderWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getInboxForwarderValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<InboxForwarderDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox forwarder (asynchronously)
* Get inbox ruleset
* @param id ID of inbox forwarder (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxForwarderAsync(UUID id, final ApiCallback<InboxForwarderDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxForwarderValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<InboxForwarderDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxForwarderEvents
* @param id ID of inbox forwarder (required)
* @param page Optional page index in inbox forwarder event list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxForwarderEventsCall(UUID id, Integer page, Integer size, String sort, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forwarders/{id}/events"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxForwarderEventsValidateBeforeCall(UUID id, Integer page, Integer size, String sort, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getInboxForwarderEvents(Async)");
}
return getInboxForwarderEventsCall(id, page, size, sort, _callback);
}
/**
* Get an inbox forwarder event list
* Get inbox ruleset events
* @param id ID of inbox forwarder (required)
* @param page Optional page index in inbox forwarder event list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @return PageInboxForwarderEvents
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxForwarderEvents getInboxForwarderEvents(UUID id, Integer page, Integer size, String sort) throws ApiException {
ApiResponse<PageInboxForwarderEvents> localVarResp = getInboxForwarderEventsWithHttpInfo(id, page, size, sort);
return localVarResp.getData();
}
/**
* Get an inbox forwarder event list
* Get inbox ruleset events
* @param id ID of inbox forwarder (required)
* @param page Optional page index in inbox forwarder event list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @return ApiResponse<PageInboxForwarderEvents>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxForwarderEvents> getInboxForwarderEventsWithHttpInfo(UUID id, Integer page, Integer size, String sort) throws ApiException {
okhttp3.Call localVarCall = getInboxForwarderEventsValidateBeforeCall(id, page, size, sort, null);
Type localVarReturnType = new TypeToken<PageInboxForwarderEvents>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox forwarder event list (asynchronously)
* Get inbox ruleset events
* @param id ID of inbox forwarder (required)
* @param page Optional page index in inbox forwarder event list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder event list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxForwarderEventsAsync(UUID id, Integer page, Integer size, String sort, final ApiCallback<PageInboxForwarderEvents> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxForwarderEventsValidateBeforeCall(id, page, size, sort, _callback);
Type localVarReturnType = new TypeToken<PageInboxForwarderEvents>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxForwarders
* @param inboxId Optional inbox id to get forwarders from (optional)
* @param page Optional page index in inbox forwarder list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxForwardersCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forwarders";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxForwardersValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getInboxForwardersCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* List inbox forwarders
* List all forwarders attached to an inbox
* @param inboxId Optional inbox id to get forwarders from (optional)
* @param page Optional page index in inbox forwarder list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageInboxForwarderDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxForwarderDto getInboxForwarders(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageInboxForwarderDto> localVarResp = getInboxForwardersWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* List inbox forwarders
* List all forwarders attached to an inbox
* @param inboxId Optional inbox id to get forwarders from (optional)
* @param page Optional page index in inbox forwarder list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageInboxForwarderDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxForwarderDto> getInboxForwardersWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxForwardersValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageInboxForwarderDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List inbox forwarders (asynchronously)
* List all forwarders attached to an inbox
* @param inboxId Optional inbox id to get forwarders from (optional)
* @param page Optional page index in inbox forwarder list pagination (optional, default to 0)
* @param size Optional page size in inbox forwarder list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxForwardersAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageInboxForwarderDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxForwardersValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageInboxForwarderDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testInboxForwarder
* @param id ID of inbox forwarder (required)
* @param inboxForwarderTestOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxForwarderCall(UUID id, InboxForwarderTestOptions inboxForwarderTestOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = inboxForwarderTestOptions;
// create path and map variables
String localVarPath = "/forwarders/{id}/test"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testInboxForwarderValidateBeforeCall(UUID id, InboxForwarderTestOptions inboxForwarderTestOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling testInboxForwarder(Async)");
}
// verify the required parameter 'inboxForwarderTestOptions' is set
if (inboxForwarderTestOptions == null) {
throw new ApiException("Missing the required parameter 'inboxForwarderTestOptions' when calling testInboxForwarder(Async)");
}
return testInboxForwarderCall(id, inboxForwarderTestOptions, _callback);
}
/**
* Test an inbox forwarder
* Test an inbox forwarder
* @param id ID of inbox forwarder (required)
* @param inboxForwarderTestOptions (required)
* @return InboxForwarderTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxForwarderTestResult testInboxForwarder(UUID id, InboxForwarderTestOptions inboxForwarderTestOptions) throws ApiException {
ApiResponse<InboxForwarderTestResult> localVarResp = testInboxForwarderWithHttpInfo(id, inboxForwarderTestOptions);
return localVarResp.getData();
}
/**
* Test an inbox forwarder
* Test an inbox forwarder
* @param id ID of inbox forwarder (required)
* @param inboxForwarderTestOptions (required)
* @return ApiResponse<InboxForwarderTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxForwarderTestResult> testInboxForwarderWithHttpInfo(UUID id, InboxForwarderTestOptions inboxForwarderTestOptions) throws ApiException {
okhttp3.Call localVarCall = testInboxForwarderValidateBeforeCall(id, inboxForwarderTestOptions, null);
Type localVarReturnType = new TypeToken<InboxForwarderTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test an inbox forwarder (asynchronously)
* Test an inbox forwarder
* @param id ID of inbox forwarder (required)
* @param inboxForwarderTestOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxForwarderAsync(UUID id, InboxForwarderTestOptions inboxForwarderTestOptions, final ApiCallback<InboxForwarderTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = testInboxForwarderValidateBeforeCall(id, inboxForwarderTestOptions, _callback);
Type localVarReturnType = new TypeToken<InboxForwarderTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testInboxForwardersForInbox
* @param inboxId ID of inbox (required)
* @param inboxForwarderTestOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxForwardersForInboxCall(UUID inboxId, InboxForwarderTestOptions inboxForwarderTestOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = inboxForwarderTestOptions;
// create path and map variables
String localVarPath = "/forwarders";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testInboxForwardersForInboxValidateBeforeCall(UUID inboxId, InboxForwarderTestOptions inboxForwarderTestOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling testInboxForwardersForInbox(Async)");
}
// verify the required parameter 'inboxForwarderTestOptions' is set
if (inboxForwarderTestOptions == null) {
throw new ApiException("Missing the required parameter 'inboxForwarderTestOptions' when calling testInboxForwardersForInbox(Async)");
}
return testInboxForwardersForInboxCall(inboxId, inboxForwarderTestOptions, _callback);
}
/**
* Test inbox forwarders for inbox
* Test inbox forwarders for inbox
* @param inboxId ID of inbox (required)
* @param inboxForwarderTestOptions (required)
* @return InboxForwarderTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxForwarderTestResult testInboxForwardersForInbox(UUID inboxId, InboxForwarderTestOptions inboxForwarderTestOptions) throws ApiException {
ApiResponse<InboxForwarderTestResult> localVarResp = testInboxForwardersForInboxWithHttpInfo(inboxId, inboxForwarderTestOptions);
return localVarResp.getData();
}
/**
* Test inbox forwarders for inbox
* Test inbox forwarders for inbox
* @param inboxId ID of inbox (required)
* @param inboxForwarderTestOptions (required)
* @return ApiResponse<InboxForwarderTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxForwarderTestResult> testInboxForwardersForInboxWithHttpInfo(UUID inboxId, InboxForwarderTestOptions inboxForwarderTestOptions) throws ApiException {
okhttp3.Call localVarCall = testInboxForwardersForInboxValidateBeforeCall(inboxId, inboxForwarderTestOptions, null);
Type localVarReturnType = new TypeToken<InboxForwarderTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test inbox forwarders for inbox (asynchronously)
* Test inbox forwarders for inbox
* @param inboxId ID of inbox (required)
* @param inboxForwarderTestOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testInboxForwardersForInboxAsync(UUID inboxId, InboxForwarderTestOptions inboxForwarderTestOptions, final ApiCallback<InboxForwarderTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = testInboxForwardersForInboxValidateBeforeCall(inboxId, inboxForwarderTestOptions, _callback);
Type localVarReturnType = new TypeToken<InboxForwarderTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for testNewInboxForwarder
* @param testNewInboxForwarderOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testNewInboxForwarderCall(TestNewInboxForwarderOptions testNewInboxForwarderOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = testNewInboxForwarderOptions;
// create path and map variables
String localVarPath = "/forwarders";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call testNewInboxForwarderValidateBeforeCall(TestNewInboxForwarderOptions testNewInboxForwarderOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'testNewInboxForwarderOptions' is set
if (testNewInboxForwarderOptions == null) {
throw new ApiException("Missing the required parameter 'testNewInboxForwarderOptions' when calling testNewInboxForwarder(Async)");
}
return testNewInboxForwarderCall(testNewInboxForwarderOptions, _callback);
}
/**
* Test new inbox forwarder
* Test new inbox forwarder
* @param testNewInboxForwarderOptions (required)
* @return InboxForwarderTestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxForwarderTestResult testNewInboxForwarder(TestNewInboxForwarderOptions testNewInboxForwarderOptions) throws ApiException {
ApiResponse<InboxForwarderTestResult> localVarResp = testNewInboxForwarderWithHttpInfo(testNewInboxForwarderOptions);
return localVarResp.getData();
}
/**
* Test new inbox forwarder
* Test new inbox forwarder
* @param testNewInboxForwarderOptions (required)
* @return ApiResponse<InboxForwarderTestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxForwarderTestResult> testNewInboxForwarderWithHttpInfo(TestNewInboxForwarderOptions testNewInboxForwarderOptions) throws ApiException {
okhttp3.Call localVarCall = testNewInboxForwarderValidateBeforeCall(testNewInboxForwarderOptions, null);
Type localVarReturnType = new TypeToken<InboxForwarderTestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Test new inbox forwarder (asynchronously)
* Test new inbox forwarder
* @param testNewInboxForwarderOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call testNewInboxForwarderAsync(TestNewInboxForwarderOptions testNewInboxForwarderOptions, final ApiCallback<InboxForwarderTestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = testNewInboxForwarderValidateBeforeCall(testNewInboxForwarderOptions, _callback);
Type localVarReturnType = new TypeToken<InboxForwarderTestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateInboxForwarder
* @param id ID of inbox forwarder (required)
* @param createInboxForwarderOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateInboxForwarderCall(UUID id, CreateInboxForwarderOptions createInboxForwarderOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createInboxForwarderOptions;
// create path and map variables
String localVarPath = "/forwarders/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateInboxForwarderValidateBeforeCall(UUID id, CreateInboxForwarderOptions createInboxForwarderOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling updateInboxForwarder(Async)");
}
// verify the required parameter 'createInboxForwarderOptions' is set
if (createInboxForwarderOptions == null) {
throw new ApiException("Missing the required parameter 'createInboxForwarderOptions' when calling updateInboxForwarder(Async)");
}
return updateInboxForwarderCall(id, createInboxForwarderOptions, _callback);
}
/**
* Update an inbox forwarder
* Update inbox ruleset
* @param id ID of inbox forwarder (required)
* @param createInboxForwarderOptions (required)
* @return InboxForwarderDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxForwarderDto updateInboxForwarder(UUID id, CreateInboxForwarderOptions createInboxForwarderOptions) throws ApiException {
ApiResponse<InboxForwarderDto> localVarResp = updateInboxForwarderWithHttpInfo(id, createInboxForwarderOptions);
return localVarResp.getData();
}
/**
* Update an inbox forwarder
* Update inbox ruleset
* @param id ID of inbox forwarder (required)
* @param createInboxForwarderOptions (required)
* @return ApiResponse<InboxForwarderDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxForwarderDto> updateInboxForwarderWithHttpInfo(UUID id, CreateInboxForwarderOptions createInboxForwarderOptions) throws ApiException {
okhttp3.Call localVarCall = updateInboxForwarderValidateBeforeCall(id, createInboxForwarderOptions, null);
Type localVarReturnType = new TypeToken<InboxForwarderDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update an inbox forwarder (asynchronously)
* Update inbox ruleset
* @param id ID of inbox forwarder (required)
* @param createInboxForwarderOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateInboxForwarderAsync(UUID id, CreateInboxForwarderOptions createInboxForwarderOptions, final ApiCallback<InboxForwarderDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateInboxForwarderValidateBeforeCall(id, createInboxForwarderOptions, _callback);
Type localVarReturnType = new TypeToken<InboxForwarderDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CountDto;
import com.mailslurp.models.CreateInboxDto;
import com.mailslurp.models.CreateInboxRulesetOptions;
import com.mailslurp.models.Email;
import com.mailslurp.models.EmailPreview;
import com.mailslurp.models.FlushExpiredInboxesResult;
import com.mailslurp.models.ImapSmtpAccessDetails;
import com.mailslurp.models.InboxByEmailAddressResult;
import com.mailslurp.models.InboxByNameResult;
import com.mailslurp.models.InboxDto;
import com.mailslurp.models.InboxExistsDto;
import com.mailslurp.models.InboxIdsResult;
import com.mailslurp.models.InboxRulesetDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageDeliveryStatus;
import com.mailslurp.models.PageEmailPreview;
import com.mailslurp.models.PageInboxProjection;
import com.mailslurp.models.PageInboxRulesetDto;
import com.mailslurp.models.PageOrganizationInboxProjection;
import com.mailslurp.models.PageScheduledJobs;
import com.mailslurp.models.PageSentEmailProjection;
import com.mailslurp.models.PageTrackingPixelProjection;
import com.mailslurp.models.ScheduledJobDto;
import com.mailslurp.models.SendEmailOptions;
import com.mailslurp.models.SendSMTPEnvelopeOptions;
import com.mailslurp.models.SentEmailDto;
import com.mailslurp.models.SetInboxFavouritedOptions;
import java.util.UUID;
import com.mailslurp.models.UpdateInboxOptions;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class InboxControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public InboxControllerApi() {
this(Configuration.getDefaultApiClient());
}
public InboxControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for cancelScheduledJob
* @param jobId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call cancelScheduledJobCall(UUID jobId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/scheduled-jobs/{jobId}"
.replace("{" + "jobId" + "}", localVarApiClient.escapeString(jobId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call cancelScheduledJobValidateBeforeCall(UUID jobId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'jobId' is set
if (jobId == null) {
throw new ApiException("Missing the required parameter 'jobId' when calling cancelScheduledJob(Async)");
}
return cancelScheduledJobCall(jobId, _callback);
}
/**
* Cancel a scheduled email job
* Get a scheduled email job and cancel it. Will fail if status of job is already cancelled, failed, or complete.
* @param jobId (required)
* @return ScheduledJobDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ScheduledJobDto cancelScheduledJob(UUID jobId) throws ApiException {
ApiResponse<ScheduledJobDto> localVarResp = cancelScheduledJobWithHttpInfo(jobId);
return localVarResp.getData();
}
/**
* Cancel a scheduled email job
* Get a scheduled email job and cancel it. Will fail if status of job is already cancelled, failed, or complete.
* @param jobId (required)
* @return ApiResponse<ScheduledJobDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ScheduledJobDto> cancelScheduledJobWithHttpInfo(UUID jobId) throws ApiException {
okhttp3.Call localVarCall = cancelScheduledJobValidateBeforeCall(jobId, null);
Type localVarReturnType = new TypeToken<ScheduledJobDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Cancel a scheduled email job (asynchronously)
* Get a scheduled email job and cancel it. Will fail if status of job is already cancelled, failed, or complete.
* @param jobId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call cancelScheduledJobAsync(UUID jobId, final ApiCallback<ScheduledJobDto> _callback) throws ApiException {
okhttp3.Call localVarCall = cancelScheduledJobValidateBeforeCall(jobId, _callback);
Type localVarReturnType = new TypeToken<ScheduledJobDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createInbox
* @param emailAddress A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional)
* @param tags Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional)
* @param name Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional)
* @param description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional)
* @param useDomainPool Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional)
* @param favourite Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional)
* @param expiresAt Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional)
* @param expiresIn Number of milliseconds that inbox should exist for (optional)
* @param allowTeamAccess DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional)
* @param inboxType HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional)
* @param virtualInbox Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional)
* @param useShortAddress Use a shorter email address under 31 characters (optional)
* @param domainId ID of custom domain to use for email address. (optional)
* @param domainName FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxCall(String emailAddress, List<String> tags, String name, String description, Boolean useDomainPool, Boolean favourite, OffsetDateTime expiresAt, Long expiresIn, Boolean allowTeamAccess, String inboxType, Boolean virtualInbox, Boolean useShortAddress, UUID domainId, String domainName, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailAddress", emailAddress));
}
if (tags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "tags", tags));
}
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
if (description != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("description", description));
}
if (useDomainPool != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useDomainPool", useDomainPool));
}
if (favourite != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("favourite", favourite));
}
if (expiresAt != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresAt", expiresAt));
}
if (expiresIn != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresIn", expiresIn));
}
if (allowTeamAccess != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowTeamAccess", allowTeamAccess));
}
if (inboxType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxType", inboxType));
}
if (virtualInbox != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("virtualInbox", virtualInbox));
}
if (useShortAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useShortAddress", useShortAddress));
}
if (domainId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainId", domainId));
}
if (domainName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainName", domainName));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createInboxValidateBeforeCall(String emailAddress, List<String> tags, String name, String description, Boolean useDomainPool, Boolean favourite, OffsetDateTime expiresAt, Long expiresIn, Boolean allowTeamAccess, String inboxType, Boolean virtualInbox, Boolean useShortAddress, UUID domainId, String domainName, final ApiCallback _callback) throws ApiException {
return createInboxCall(emailAddress, tags, name, description, useDomainPool, favourite, expiresAt, expiresIn, allowTeamAccess, inboxType, virtualInbox, useShortAddress, domainId, domainName, _callback);
}
/**
* Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes.
* Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.
* @param emailAddress A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional)
* @param tags Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional)
* @param name Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional)
* @param description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional)
* @param useDomainPool Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional)
* @param favourite Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional)
* @param expiresAt Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional)
* @param expiresIn Number of milliseconds that inbox should exist for (optional)
* @param allowTeamAccess DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional)
* @param inboxType HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional)
* @param virtualInbox Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional)
* @param useShortAddress Use a shorter email address under 31 characters (optional)
* @param domainId ID of custom domain to use for email address. (optional)
* @param domainName FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox. (optional)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public InboxDto createInbox(String emailAddress, List<String> tags, String name, String description, Boolean useDomainPool, Boolean favourite, OffsetDateTime expiresAt, Long expiresIn, Boolean allowTeamAccess, String inboxType, Boolean virtualInbox, Boolean useShortAddress, UUID domainId, String domainName) throws ApiException {
ApiResponse<InboxDto> localVarResp = createInboxWithHttpInfo(emailAddress, tags, name, description, useDomainPool, favourite, expiresAt, expiresIn, allowTeamAccess, inboxType, virtualInbox, useShortAddress, domainId, domainName);
return localVarResp.getData();
}
/**
* Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes.
* Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.
* @param emailAddress A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional)
* @param tags Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional)
* @param name Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional)
* @param description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional)
* @param useDomainPool Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional)
* @param favourite Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional)
* @param expiresAt Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional)
* @param expiresIn Number of milliseconds that inbox should exist for (optional)
* @param allowTeamAccess DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional)
* @param inboxType HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional)
* @param virtualInbox Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional)
* @param useShortAddress Use a shorter email address under 31 characters (optional)
* @param domainId ID of custom domain to use for email address. (optional)
* @param domainName FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox. (optional)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> createInboxWithHttpInfo(String emailAddress, List<String> tags, String name, String description, Boolean useDomainPool, Boolean favourite, OffsetDateTime expiresAt, Long expiresIn, Boolean allowTeamAccess, String inboxType, Boolean virtualInbox, Boolean useShortAddress, UUID domainId, String domainName) throws ApiException {
okhttp3.Call localVarCall = createInboxValidateBeforeCall(emailAddress, tags, name, description, useDomainPool, favourite, expiresAt, expiresIn, allowTeamAccess, inboxType, virtualInbox, useShortAddress, domainId, domainName, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. (asynchronously)
* Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty.
* @param emailAddress A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. (optional)
* @param tags Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. (optional)
* @param name Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. (optional)
* @param description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with (optional)
* @param useDomainPool Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. (optional)
* @param favourite Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering (optional)
* @param expiresAt Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. (optional)
* @param expiresIn Number of milliseconds that inbox should exist for (optional)
* @param allowTeamAccess DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. (optional)
* @param inboxType HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. (optional)
* @param virtualInbox Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. (optional)
* @param useShortAddress Use a shorter email address under 31 characters (optional)
* @param domainId ID of custom domain to use for email address. (optional)
* @param domainName FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxAsync(String emailAddress, List<String> tags, String name, String description, Boolean useDomainPool, Boolean favourite, OffsetDateTime expiresAt, Long expiresIn, Boolean allowTeamAccess, String inboxType, Boolean virtualInbox, Boolean useShortAddress, UUID domainId, String domainName, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createInboxValidateBeforeCall(emailAddress, tags, name, description, useDomainPool, favourite, expiresAt, expiresIn, allowTeamAccess, inboxType, virtualInbox, useShortAddress, domainId, domainName, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createInboxRuleset
* @param inboxId inboxId (required)
* @param createInboxRulesetOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxRulesetCall(UUID inboxId, CreateInboxRulesetOptions createInboxRulesetOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createInboxRulesetOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/rulesets"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createInboxRulesetValidateBeforeCall(UUID inboxId, CreateInboxRulesetOptions createInboxRulesetOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling createInboxRuleset(Async)");
}
// verify the required parameter 'createInboxRulesetOptions' is set
if (createInboxRulesetOptions == null) {
throw new ApiException("Missing the required parameter 'createInboxRulesetOptions' when calling createInboxRuleset(Async)");
}
return createInboxRulesetCall(inboxId, createInboxRulesetOptions, _callback);
}
/**
* Create an inbox ruleset
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param inboxId inboxId (required)
* @param createInboxRulesetOptions (required)
* @return InboxRulesetDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxRulesetDto createInboxRuleset(UUID inboxId, CreateInboxRulesetOptions createInboxRulesetOptions) throws ApiException {
ApiResponse<InboxRulesetDto> localVarResp = createInboxRulesetWithHttpInfo(inboxId, createInboxRulesetOptions);
return localVarResp.getData();
}
/**
* Create an inbox ruleset
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param inboxId inboxId (required)
* @param createInboxRulesetOptions (required)
* @return ApiResponse<InboxRulesetDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxRulesetDto> createInboxRulesetWithHttpInfo(UUID inboxId, CreateInboxRulesetOptions createInboxRulesetOptions) throws ApiException {
okhttp3.Call localVarCall = createInboxRulesetValidateBeforeCall(inboxId, createInboxRulesetOptions, null);
Type localVarReturnType = new TypeToken<InboxRulesetDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox ruleset (asynchronously)
* Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
* @param inboxId inboxId (required)
* @param createInboxRulesetOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxRulesetAsync(UUID inboxId, CreateInboxRulesetOptions createInboxRulesetOptions, final ApiCallback<InboxRulesetDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createInboxRulesetValidateBeforeCall(inboxId, createInboxRulesetOptions, _callback);
Type localVarReturnType = new TypeToken<InboxRulesetDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createInboxWithDefaults
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxWithDefaultsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/withDefaults";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createInboxWithDefaultsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return createInboxWithDefaultsCall(_callback);
}
/**
* Create an inbox with default options. Uses MailSlurp domain pool address and is private.
*
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public InboxDto createInboxWithDefaults() throws ApiException {
ApiResponse<InboxDto> localVarResp = createInboxWithDefaultsWithHttpInfo();
return localVarResp.getData();
}
/**
* Create an inbox with default options. Uses MailSlurp domain pool address and is private.
*
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> createInboxWithDefaultsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = createInboxWithDefaultsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox with default options. Uses MailSlurp domain pool address and is private. (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxWithDefaultsAsync(final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createInboxWithDefaultsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createInboxWithOptions
* @param createInboxDto (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxWithOptionsCall(CreateInboxDto createInboxDto, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createInboxDto;
// create path and map variables
String localVarPath = "/inboxes/withOptions";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createInboxWithOptionsValidateBeforeCall(CreateInboxDto createInboxDto, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createInboxDto' is set
if (createInboxDto == null) {
throw new ApiException("Missing the required parameter 'createInboxDto' when calling createInboxWithOptions(Async)");
}
return createInboxWithOptionsCall(createInboxDto, _callback);
}
/**
* Create an inbox with options. Extended options for inbox creation.
* Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
* @param createInboxDto (required)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public InboxDto createInboxWithOptions(CreateInboxDto createInboxDto) throws ApiException {
ApiResponse<InboxDto> localVarResp = createInboxWithOptionsWithHttpInfo(createInboxDto);
return localVarResp.getData();
}
/**
* Create an inbox with options. Extended options for inbox creation.
* Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
* @param createInboxDto (required)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> createInboxWithOptionsWithHttpInfo(CreateInboxDto createInboxDto) throws ApiException {
okhttp3.Call localVarCall = createInboxWithOptionsValidateBeforeCall(createInboxDto, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox with options. Extended options for inbox creation. (asynchronously)
* Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
* @param createInboxDto (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createInboxWithOptionsAsync(CreateInboxDto createInboxDto, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createInboxWithOptionsValidateBeforeCall(createInboxDto, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteAllInboxEmails
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllInboxEmailsCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/deleteAllInboxEmails"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAllInboxEmailsValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling deleteAllInboxEmails(Async)");
}
return deleteAllInboxEmailsCall(inboxId, _callback);
}
/**
* Delete all emails in a given inboxes.
* Deletes all emails in an inbox. Be careful as emails cannot be recovered
* @param inboxId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAllInboxEmails(UUID inboxId) throws ApiException {
deleteAllInboxEmailsWithHttpInfo(inboxId);
}
/**
* Delete all emails in a given inboxes.
* Deletes all emails in an inbox. Be careful as emails cannot be recovered
* @param inboxId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAllInboxEmailsWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = deleteAllInboxEmailsValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all emails in a given inboxes. (asynchronously)
* Deletes all emails in an inbox. Be careful as emails cannot be recovered
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllInboxEmailsAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAllInboxEmailsValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteAllInboxes
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllInboxesCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAllInboxesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return deleteAllInboxesCall(_callback);
}
/**
* Delete all inboxes
* Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAllInboxes() throws ApiException {
deleteAllInboxesWithHttpInfo();
}
/**
* Delete all inboxes
* Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAllInboxesWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = deleteAllInboxesValidateBeforeCall(null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all inboxes (asynchronously)
* Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllInboxesAsync(final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAllInboxesValidateBeforeCall(_callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteInbox
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteInboxValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling deleteInbox(Async)");
}
return deleteInboxCall(inboxId, _callback);
}
/**
* Delete inbox
* Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.
* @param inboxId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteInbox(UUID inboxId) throws ApiException {
deleteInboxWithHttpInfo(inboxId);
}
/**
* Delete inbox
* Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.
* @param inboxId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteInboxWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = deleteInboxValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete inbox (asynchronously)
* Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request.
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteInboxAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteInboxValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for doesInboxExist
* @param emailAddress Email address (required)
* @param allowCatchAll (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call doesInboxExistCall(String emailAddress, Boolean allowCatchAll, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/exists";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailAddress", emailAddress));
}
if (allowCatchAll != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowCatchAll", allowCatchAll));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call doesInboxExistValidateBeforeCall(String emailAddress, Boolean allowCatchAll, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailAddress' is set
if (emailAddress == null) {
throw new ApiException("Missing the required parameter 'emailAddress' when calling doesInboxExist(Async)");
}
return doesInboxExistCall(emailAddress, allowCatchAll, _callback);
}
/**
* Does inbox exist
* Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses
* @param emailAddress Email address (required)
* @param allowCatchAll (optional)
* @return InboxExistsDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxExistsDto doesInboxExist(String emailAddress, Boolean allowCatchAll) throws ApiException {
ApiResponse<InboxExistsDto> localVarResp = doesInboxExistWithHttpInfo(emailAddress, allowCatchAll);
return localVarResp.getData();
}
/**
* Does inbox exist
* Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses
* @param emailAddress Email address (required)
* @param allowCatchAll (optional)
* @return ApiResponse<InboxExistsDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxExistsDto> doesInboxExistWithHttpInfo(String emailAddress, Boolean allowCatchAll) throws ApiException {
okhttp3.Call localVarCall = doesInboxExistValidateBeforeCall(emailAddress, allowCatchAll, null);
Type localVarReturnType = new TypeToken<InboxExistsDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Does inbox exist (asynchronously)
* Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses
* @param emailAddress Email address (required)
* @param allowCatchAll (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call doesInboxExistAsync(String emailAddress, Boolean allowCatchAll, final ApiCallback<InboxExistsDto> _callback) throws ApiException {
okhttp3.Call localVarCall = doesInboxExistValidateBeforeCall(emailAddress, allowCatchAll, _callback);
Type localVarReturnType = new TypeToken<InboxExistsDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for flushExpired
* @param before Optional expired at before flag to flush expired inboxes that have expired before the given time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call flushExpiredCall(OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/expired";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call flushExpiredValidateBeforeCall(OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return flushExpiredCall(before, _callback);
}
/**
* Remove expired inboxes
* Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)
* @param before Optional expired at before flag to flush expired inboxes that have expired before the given time (optional)
* @return FlushExpiredInboxesResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public FlushExpiredInboxesResult flushExpired(OffsetDateTime before) throws ApiException {
ApiResponse<FlushExpiredInboxesResult> localVarResp = flushExpiredWithHttpInfo(before);
return localVarResp.getData();
}
/**
* Remove expired inboxes
* Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)
* @param before Optional expired at before flag to flush expired inboxes that have expired before the given time (optional)
* @return ApiResponse<FlushExpiredInboxesResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<FlushExpiredInboxesResult> flushExpiredWithHttpInfo(OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = flushExpiredValidateBeforeCall(before, null);
Type localVarReturnType = new TypeToken<FlushExpiredInboxesResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Remove expired inboxes (asynchronously)
* Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)
* @param before Optional expired at before flag to flush expired inboxes that have expired before the given time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call flushExpiredAsync(OffsetDateTime before, final ApiCallback<FlushExpiredInboxesResult> _callback) throws ApiException {
okhttp3.Call localVarCall = flushExpiredValidateBeforeCall(before, _callback);
Type localVarReturnType = new TypeToken<FlushExpiredInboxesResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAllInboxes
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param favourite Optionally filter results for favourites only (optional, default to false)
* @param search Optionally filter by search words partial matching ID, tags, name, and email address (optional)
* @param tag Optionally filter by tags. Will return inboxes that include given tags (optional)
* @param teamAccess DEPRECATED. Optionally filter by team access. (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param inboxType Optional filter by inbox type (optional)
* @param domainId Optional domain ID filter (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllInboxesCall(Integer page, Integer size, String sort, Boolean favourite, String search, String tag, Boolean teamAccess, OffsetDateTime since, OffsetDateTime before, String inboxType, UUID domainId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/paginated";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (favourite != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("favourite", favourite));
}
if (search != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search));
}
if (tag != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("tag", tag));
}
if (teamAccess != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("teamAccess", teamAccess));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (inboxType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxType", inboxType));
}
if (domainId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainId", domainId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllInboxesValidateBeforeCall(Integer page, Integer size, String sort, Boolean favourite, String search, String tag, Boolean teamAccess, OffsetDateTime since, OffsetDateTime before, String inboxType, UUID domainId, final ApiCallback _callback) throws ApiException {
return getAllInboxesCall(page, size, sort, favourite, search, tag, teamAccess, since, before, inboxType, domainId, _callback);
}
/**
* List All Inboxes Paginated
* List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param favourite Optionally filter results for favourites only (optional, default to false)
* @param search Optionally filter by search words partial matching ID, tags, name, and email address (optional)
* @param tag Optionally filter by tags. Will return inboxes that include given tags (optional)
* @param teamAccess DEPRECATED. Optionally filter by team access. (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param inboxType Optional filter by inbox type (optional)
* @param domainId Optional domain ID filter (optional)
* @return PageInboxProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxProjection getAllInboxes(Integer page, Integer size, String sort, Boolean favourite, String search, String tag, Boolean teamAccess, OffsetDateTime since, OffsetDateTime before, String inboxType, UUID domainId) throws ApiException {
ApiResponse<PageInboxProjection> localVarResp = getAllInboxesWithHttpInfo(page, size, sort, favourite, search, tag, teamAccess, since, before, inboxType, domainId);
return localVarResp.getData();
}
/**
* List All Inboxes Paginated
* List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param favourite Optionally filter results for favourites only (optional, default to false)
* @param search Optionally filter by search words partial matching ID, tags, name, and email address (optional)
* @param tag Optionally filter by tags. Will return inboxes that include given tags (optional)
* @param teamAccess DEPRECATED. Optionally filter by team access. (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param inboxType Optional filter by inbox type (optional)
* @param domainId Optional domain ID filter (optional)
* @return ApiResponse<PageInboxProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxProjection> getAllInboxesWithHttpInfo(Integer page, Integer size, String sort, Boolean favourite, String search, String tag, Boolean teamAccess, OffsetDateTime since, OffsetDateTime before, String inboxType, UUID domainId) throws ApiException {
okhttp3.Call localVarCall = getAllInboxesValidateBeforeCall(page, size, sort, favourite, search, tag, teamAccess, since, before, inboxType, domainId, null);
Type localVarReturnType = new TypeToken<PageInboxProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List All Inboxes Paginated (asynchronously)
* List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results.
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param favourite Optionally filter results for favourites only (optional, default to false)
* @param search Optionally filter by search words partial matching ID, tags, name, and email address (optional)
* @param tag Optionally filter by tags. Will return inboxes that include given tags (optional)
* @param teamAccess DEPRECATED. Optionally filter by team access. (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param inboxType Optional filter by inbox type (optional)
* @param domainId Optional domain ID filter (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllInboxesAsync(Integer page, Integer size, String sort, Boolean favourite, String search, String tag, Boolean teamAccess, OffsetDateTime since, OffsetDateTime before, String inboxType, UUID domainId, final ApiCallback<PageInboxProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllInboxesValidateBeforeCall(page, size, sort, favourite, search, tag, teamAccess, since, before, inboxType, domainId, _callback);
Type localVarReturnType = new TypeToken<PageInboxProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAllScheduledJobs
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllScheduledJobsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/scheduled-jobs";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllScheduledJobsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllScheduledJobsCall(page, size, sort, since, before, _callback);
}
/**
* Get all scheduled email sending jobs for account
* Schedule sending of emails using scheduled jobs. These can be inbox or account level.
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageScheduledJobs
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageScheduledJobs getAllScheduledJobs(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageScheduledJobs> localVarResp = getAllScheduledJobsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get all scheduled email sending jobs for account
* Schedule sending of emails using scheduled jobs. These can be inbox or account level.
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageScheduledJobs>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageScheduledJobs> getAllScheduledJobsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllScheduledJobsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageScheduledJobs>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all scheduled email sending jobs for account (asynchronously)
* Schedule sending of emails using scheduled jobs. These can be inbox or account level.
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllScheduledJobsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageScheduledJobs> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllScheduledJobsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageScheduledJobs>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getDeliveryStatusesByInboxId
* @param inboxId (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDeliveryStatusesByInboxIdCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/delivery-status"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDeliveryStatusesByInboxIdValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getDeliveryStatusesByInboxId(Async)");
}
return getDeliveryStatusesByInboxIdCall(inboxId, page, size, sort, since, before, _callback);
}
/**
*
* Get all email delivery statuses for an inbox
* @param inboxId (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageDeliveryStatus
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageDeliveryStatus getDeliveryStatusesByInboxId(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageDeliveryStatus> localVarResp = getDeliveryStatusesByInboxIdWithHttpInfo(inboxId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
*
* Get all email delivery statuses for an inbox
* @param inboxId (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageDeliveryStatus>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageDeliveryStatus> getDeliveryStatusesByInboxIdWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getDeliveryStatusesByInboxIdValidateBeforeCall(inboxId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageDeliveryStatus>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get all email delivery statuses for an inbox
* @param inboxId (required)
* @param page Optional page index in delivery status list pagination (optional, default to 0)
* @param size Optional page size in delivery status list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDeliveryStatusesByInboxIdAsync(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageDeliveryStatus> _callback) throws ApiException {
okhttp3.Call localVarCall = getDeliveryStatusesByInboxIdValidateBeforeCall(inboxId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageDeliveryStatus>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmails
* @param inboxId Id of inbox that emails belongs to (required)
* @param size Alias for limit. Assessed first before assessing any passed limit. (optional)
* @param limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional)
* @param sort Sort the results by received date and direction ASC or DESC (optional)
* @param retryTimeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional)
* @param delayTimeout (optional)
* @param minCount Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional)
* @param unreadOnly (optional)
* @param before Exclude emails received after this ISO 8601 date time (optional)
* @param since Exclude emails received before this ISO 8601 date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailsCall(UUID inboxId, Integer size, Integer limit, String sort, Long retryTimeout, Long delayTimeout, Long minCount, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/emails"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (limit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (retryTimeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("retryTimeout", retryTimeout));
}
if (delayTimeout != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("delayTimeout", delayTimeout));
}
if (minCount != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("minCount", minCount));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailsValidateBeforeCall(UUID inboxId, Integer size, Integer limit, String sort, Long retryTimeout, Long delayTimeout, Long minCount, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getEmails(Async)");
}
return getEmailsCall(inboxId, size, limit, sort, retryTimeout, delayTimeout, minCount, unreadOnly, before, since, _callback);
}
/**
* Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
* List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
* @param inboxId Id of inbox that emails belongs to (required)
* @param size Alias for limit. Assessed first before assessing any passed limit. (optional)
* @param limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional)
* @param sort Sort the results by received date and direction ASC or DESC (optional)
* @param retryTimeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional)
* @param delayTimeout (optional)
* @param minCount Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional)
* @param unreadOnly (optional)
* @param before Exclude emails received after this ISO 8601 date time (optional)
* @param since Exclude emails received before this ISO 8601 date time (optional)
* @return List<EmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<EmailPreview> getEmails(UUID inboxId, Integer size, Integer limit, String sort, Long retryTimeout, Long delayTimeout, Long minCount, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since) throws ApiException {
ApiResponse<List<EmailPreview>> localVarResp = getEmailsWithHttpInfo(inboxId, size, limit, sort, retryTimeout, delayTimeout, minCount, unreadOnly, before, since);
return localVarResp.getData();
}
/**
* Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
* List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
* @param inboxId Id of inbox that emails belongs to (required)
* @param size Alias for limit. Assessed first before assessing any passed limit. (optional)
* @param limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional)
* @param sort Sort the results by received date and direction ASC or DESC (optional)
* @param retryTimeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional)
* @param delayTimeout (optional)
* @param minCount Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional)
* @param unreadOnly (optional)
* @param before Exclude emails received after this ISO 8601 date time (optional)
* @param since Exclude emails received before this ISO 8601 date time (optional)
* @return ApiResponse<List<EmailPreview>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<EmailPreview>> getEmailsWithHttpInfo(UUID inboxId, Integer size, Integer limit, String sort, Long retryTimeout, Long delayTimeout, Long minCount, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since) throws ApiException {
okhttp3.Call localVarCall = getEmailsValidateBeforeCall(inboxId, size, limit, sort, retryTimeout, delayTimeout, minCount, unreadOnly, before, since, null);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. (asynchronously)
* List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
* @param inboxId Id of inbox that emails belongs to (required)
* @param size Alias for limit. Assessed first before assessing any passed limit. (optional)
* @param limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller (optional)
* @param sort Sort the results by received date and direction ASC or DESC (optional)
* @param retryTimeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned (optional)
* @param delayTimeout (optional)
* @param minCount Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. (optional)
* @param unreadOnly (optional)
* @param before Exclude emails received after this ISO 8601 date time (optional)
* @param since Exclude emails received before this ISO 8601 date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailsAsync(UUID inboxId, Integer size, Integer limit, String sort, Long retryTimeout, Long delayTimeout, Long minCount, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, final ApiCallback<List<EmailPreview>> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailsValidateBeforeCall(inboxId, size, limit, sort, retryTimeout, delayTimeout, minCount, unreadOnly, before, since, _callback);
Type localVarReturnType = new TypeToken<List<EmailPreview>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getImapSmtpAccess
* @param inboxId Inbox ID (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getImapSmtpAccessCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/imap-smtp-access";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getImapSmtpAccessValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
return getImapSmtpAccessCall(inboxId, _callback);
}
/**
*
* Get IMAP and SMTP access usernames and passwords
* @param inboxId Inbox ID (optional)
* @return ImapSmtpAccessDetails
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ImapSmtpAccessDetails getImapSmtpAccess(UUID inboxId) throws ApiException {
ApiResponse<ImapSmtpAccessDetails> localVarResp = getImapSmtpAccessWithHttpInfo(inboxId);
return localVarResp.getData();
}
/**
*
* Get IMAP and SMTP access usernames and passwords
* @param inboxId Inbox ID (optional)
* @return ApiResponse<ImapSmtpAccessDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ImapSmtpAccessDetails> getImapSmtpAccessWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getImapSmtpAccessValidateBeforeCall(inboxId, null);
Type localVarReturnType = new TypeToken<ImapSmtpAccessDetails>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get IMAP and SMTP access usernames and passwords
* @param inboxId Inbox ID (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getImapSmtpAccessAsync(UUID inboxId, final ApiCallback<ImapSmtpAccessDetails> _callback) throws ApiException {
okhttp3.Call localVarCall = getImapSmtpAccessValidateBeforeCall(inboxId, _callback);
Type localVarReturnType = new TypeToken<ImapSmtpAccessDetails>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInbox
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getInbox(Async)");
}
return getInboxCall(inboxId, _callback);
}
/**
* Get Inbox. Returns properties of an inbox.
* Returns an inbox's properties, including its email address and ID.
* @param inboxId (required)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxDto getInbox(UUID inboxId) throws ApiException {
ApiResponse<InboxDto> localVarResp = getInboxWithHttpInfo(inboxId);
return localVarResp.getData();
}
/**
* Get Inbox. Returns properties of an inbox.
* Returns an inbox's properties, including its email address and ID.
* @param inboxId (required)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> getInboxWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getInboxValidateBeforeCall(inboxId, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Inbox. Returns properties of an inbox. (asynchronously)
* Returns an inbox's properties, including its email address and ID.
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxAsync(UUID inboxId, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxValidateBeforeCall(inboxId, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxByEmailAddress
* @param emailAddress (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxByEmailAddressCall(String emailAddress, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/byEmailAddress";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailAddress", emailAddress));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxByEmailAddressValidateBeforeCall(String emailAddress, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailAddress' is set
if (emailAddress == null) {
throw new ApiException("Missing the required parameter 'emailAddress' when calling getInboxByEmailAddress(Async)");
}
return getInboxByEmailAddressCall(emailAddress, _callback);
}
/**
* Search for an inbox with the provided email address
* Get a inbox result by email address
* @param emailAddress (required)
* @return InboxByEmailAddressResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxByEmailAddressResult getInboxByEmailAddress(String emailAddress) throws ApiException {
ApiResponse<InboxByEmailAddressResult> localVarResp = getInboxByEmailAddressWithHttpInfo(emailAddress);
return localVarResp.getData();
}
/**
* Search for an inbox with the provided email address
* Get a inbox result by email address
* @param emailAddress (required)
* @return ApiResponse<InboxByEmailAddressResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxByEmailAddressResult> getInboxByEmailAddressWithHttpInfo(String emailAddress) throws ApiException {
okhttp3.Call localVarCall = getInboxByEmailAddressValidateBeforeCall(emailAddress, null);
Type localVarReturnType = new TypeToken<InboxByEmailAddressResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Search for an inbox with the provided email address (asynchronously)
* Get a inbox result by email address
* @param emailAddress (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxByEmailAddressAsync(String emailAddress, final ApiCallback<InboxByEmailAddressResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxByEmailAddressValidateBeforeCall(emailAddress, _callback);
Type localVarReturnType = new TypeToken<InboxByEmailAddressResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxByName
* @param name (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxByNameCall(String name, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/byName";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxByNameValidateBeforeCall(String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling getInboxByName(Async)");
}
return getInboxByNameCall(name, _callback);
}
/**
* Search for an inbox with the given name
* Get a inbox result by name
* @param name (required)
* @return InboxByNameResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxByNameResult getInboxByName(String name) throws ApiException {
ApiResponse<InboxByNameResult> localVarResp = getInboxByNameWithHttpInfo(name);
return localVarResp.getData();
}
/**
* Search for an inbox with the given name
* Get a inbox result by name
* @param name (required)
* @return ApiResponse<InboxByNameResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxByNameResult> getInboxByNameWithHttpInfo(String name) throws ApiException {
okhttp3.Call localVarCall = getInboxByNameValidateBeforeCall(name, null);
Type localVarReturnType = new TypeToken<InboxByNameResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Search for an inbox with the given name (asynchronously)
* Get a inbox result by name
* @param name (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxByNameAsync(String name, final ApiCallback<InboxByNameResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxByNameValidateBeforeCall(name, _callback);
Type localVarReturnType = new TypeToken<InboxByNameResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxCount
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxCountCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/count";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxCountValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getInboxCountCall(_callback);
}
/**
* Get total inbox count
*
* @return CountDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public CountDto getInboxCount() throws ApiException {
ApiResponse<CountDto> localVarResp = getInboxCountWithHttpInfo();
return localVarResp.getData();
}
/**
* Get total inbox count
*
* @return ApiResponse<CountDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<CountDto> getInboxCountWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getInboxCountValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<CountDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get total inbox count (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxCountAsync(final ApiCallback<CountDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxCountValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<CountDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxEmailCount
* @param inboxId Id of inbox that emails belongs to (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxEmailCountCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/emails/count"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxEmailCountValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getInboxEmailCount(Async)");
}
return getInboxEmailCountCall(inboxId, _callback);
}
/**
* Get email count in inbox
*
* @param inboxId Id of inbox that emails belongs to (required)
* @return CountDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public CountDto getInboxEmailCount(UUID inboxId) throws ApiException {
ApiResponse<CountDto> localVarResp = getInboxEmailCountWithHttpInfo(inboxId);
return localVarResp.getData();
}
/**
* Get email count in inbox
*
* @param inboxId Id of inbox that emails belongs to (required)
* @return ApiResponse<CountDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<CountDto> getInboxEmailCountWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getInboxEmailCountValidateBeforeCall(inboxId, null);
Type localVarReturnType = new TypeToken<CountDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email count in inbox (asynchronously)
*
* @param inboxId Id of inbox that emails belongs to (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxEmailCountAsync(UUID inboxId, final ApiCallback<CountDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxEmailCountValidateBeforeCall(inboxId, _callback);
Type localVarReturnType = new TypeToken<CountDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxEmailsPaginated
* @param inboxId Id of inbox that emails belongs to (required)
* @param page Optional page index in inbox emails list pagination (optional, default to 0)
* @param size Optional page size in inbox emails list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by received after given date time (optional)
* @param before Optional filter by received before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxEmailsPaginatedCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/emails/paginated"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxEmailsPaginatedValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getInboxEmailsPaginated(Async)");
}
return getInboxEmailsPaginatedCall(inboxId, page, size, sort, since, before, _callback);
}
/**
* Get inbox emails paginated
* Get a paginated list of emails in an inbox. Does not hold connections open.
* @param inboxId Id of inbox that emails belongs to (required)
* @param page Optional page index in inbox emails list pagination (optional, default to 0)
* @param size Optional page size in inbox emails list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by received after given date time (optional)
* @param before Optional filter by received before given date time (optional)
* @return PageEmailPreview
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageEmailPreview getInboxEmailsPaginated(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageEmailPreview> localVarResp = getInboxEmailsPaginatedWithHttpInfo(inboxId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get inbox emails paginated
* Get a paginated list of emails in an inbox. Does not hold connections open.
* @param inboxId Id of inbox that emails belongs to (required)
* @param page Optional page index in inbox emails list pagination (optional, default to 0)
* @param size Optional page size in inbox emails list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by received after given date time (optional)
* @param before Optional filter by received before given date time (optional)
* @return ApiResponse<PageEmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageEmailPreview> getInboxEmailsPaginatedWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxEmailsPaginatedValidateBeforeCall(inboxId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageEmailPreview>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get inbox emails paginated (asynchronously)
* Get a paginated list of emails in an inbox. Does not hold connections open.
* @param inboxId Id of inbox that emails belongs to (required)
* @param page Optional page index in inbox emails list pagination (optional, default to 0)
* @param size Optional page size in inbox emails list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by received after given date time (optional)
* @param before Optional filter by received before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxEmailsPaginatedAsync(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageEmailPreview> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxEmailsPaginatedValidateBeforeCall(inboxId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageEmailPreview>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxIds
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxIdsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/ids";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxIdsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getInboxIdsCall(_callback);
}
/**
* Get all inbox IDs
* Get list of inbox IDs
* @return InboxIdsResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxIdsResult getInboxIds() throws ApiException {
ApiResponse<InboxIdsResult> localVarResp = getInboxIdsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get all inbox IDs
* Get list of inbox IDs
* @return ApiResponse<InboxIdsResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxIdsResult> getInboxIdsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getInboxIdsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<InboxIdsResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all inbox IDs (asynchronously)
* Get list of inbox IDs
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxIdsAsync(final ApiCallback<InboxIdsResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxIdsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<InboxIdsResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxSentEmails
* @param inboxId (required)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional sent email search (optional)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxSentEmailsCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/sent"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxSentEmailsValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getInboxSentEmails(Async)");
}
return getInboxSentEmailsCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* Get Inbox Sent Emails
* Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.
* @param inboxId (required)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional sent email search (optional)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @return PageSentEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageSentEmailProjection getInboxSentEmails(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageSentEmailProjection> localVarResp = getInboxSentEmailsWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* Get Inbox Sent Emails
* Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.
* @param inboxId (required)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional sent email search (optional)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @return ApiResponse<PageSentEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageSentEmailProjection> getInboxSentEmailsWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxSentEmailsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageSentEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get Inbox Sent Emails (asynchronously)
* Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead.
* @param inboxId (required)
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional sent email search (optional)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxSentEmailsAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageSentEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxSentEmailsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageSentEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxTags
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxTagsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/tags";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxTagsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getInboxTagsCall(_callback);
}
/**
* Get inbox tags
* Get all inbox tags
* @return List<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<String> getInboxTags() throws ApiException {
ApiResponse<List<String>> localVarResp = getInboxTagsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get inbox tags
* Get all inbox tags
* @return ApiResponse<List<String>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<String>> getInboxTagsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getInboxTagsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get inbox tags (asynchronously)
* Get all inbox tags
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getInboxTagsAsync(final ApiCallback<List<String>> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxTagsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getInboxes
* @param size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional, default to 100)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by created after given date time (optional)
* @param excludeCatchAllInboxes Optional exclude catch all inboxes (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public okhttp3.Call getInboxesCall(Integer size, String sort, OffsetDateTime since, Boolean excludeCatchAllInboxes, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (excludeCatchAllInboxes != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("excludeCatchAllInboxes", excludeCatchAllInboxes));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call getInboxesValidateBeforeCall(Integer size, String sort, OffsetDateTime since, Boolean excludeCatchAllInboxes, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getInboxesCall(size, sort, since, excludeCatchAllInboxes, before, _callback);
}
/**
* List Inboxes and email addresses
* List the inboxes you have created. Note use of the more advanced `getAllInboxes` is recommended and allows paginated access using a limit and sort parameter.
* @param size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional, default to 100)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by created after given date time (optional)
* @param excludeCatchAllInboxes Optional exclude catch all inboxes (optional)
* @param before Optional filter by created before given date time (optional)
* @return List<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public List<InboxDto> getInboxes(Integer size, String sort, OffsetDateTime since, Boolean excludeCatchAllInboxes, OffsetDateTime before) throws ApiException {
ApiResponse<List<InboxDto>> localVarResp = getInboxesWithHttpInfo(size, sort, since, excludeCatchAllInboxes, before);
return localVarResp.getData();
}
/**
* List Inboxes and email addresses
* List the inboxes you have created. Note use of the more advanced `getAllInboxes` is recommended and allows paginated access using a limit and sort parameter.
* @param size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional, default to 100)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by created after given date time (optional)
* @param excludeCatchAllInboxes Optional exclude catch all inboxes (optional)
* @param before Optional filter by created before given date time (optional)
* @return ApiResponse<List<InboxDto>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public ApiResponse<List<InboxDto>> getInboxesWithHttpInfo(Integer size, String sort, OffsetDateTime since, Boolean excludeCatchAllInboxes, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getInboxesValidateBeforeCall(size, sort, since, excludeCatchAllInboxes, before, null);
Type localVarReturnType = new TypeToken<List<InboxDto>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List Inboxes and email addresses (asynchronously)
* List the inboxes you have created. Note use of the more advanced `getAllInboxes` is recommended and allows paginated access using a limit and sort parameter.
* @param size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (optional, default to 100)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by created after given date time (optional)
* @param excludeCatchAllInboxes Optional exclude catch all inboxes (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
* @deprecated
*/
@Deprecated
public okhttp3.Call getInboxesAsync(Integer size, String sort, OffsetDateTime since, Boolean excludeCatchAllInboxes, OffsetDateTime before, final ApiCallback<List<InboxDto>> _callback) throws ApiException {
okhttp3.Call localVarCall = getInboxesValidateBeforeCall(size, sort, since, excludeCatchAllInboxes, before, _callback);
Type localVarReturnType = new TypeToken<List<InboxDto>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getLatestEmailInInbox
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @param timeoutMillis Timeout milliseconds to wait for latest email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getLatestEmailInInboxCall(UUID inboxId, Long timeoutMillis, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/getLatestEmail";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (timeoutMillis != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutMillis", timeoutMillis));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getLatestEmailInInboxValidateBeforeCall(UUID inboxId, Long timeoutMillis, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getLatestEmailInInbox(Async)");
}
// verify the required parameter 'timeoutMillis' is set
if (timeoutMillis == null) {
throw new ApiException("Missing the required parameter 'timeoutMillis' when calling getLatestEmailInInbox(Async)");
}
return getLatestEmailInInboxCall(inboxId, timeoutMillis, _callback);
}
/**
* Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet.
* Get the newest email in an inbox or wait for one to arrive
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @param timeoutMillis Timeout milliseconds to wait for latest email (required)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email getLatestEmailInInbox(UUID inboxId, Long timeoutMillis) throws ApiException {
ApiResponse<Email> localVarResp = getLatestEmailInInboxWithHttpInfo(inboxId, timeoutMillis);
return localVarResp.getData();
}
/**
* Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet.
* Get the newest email in an inbox or wait for one to arrive
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @param timeoutMillis Timeout milliseconds to wait for latest email (required)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> getLatestEmailInInboxWithHttpInfo(UUID inboxId, Long timeoutMillis) throws ApiException {
okhttp3.Call localVarCall = getLatestEmailInInboxValidateBeforeCall(inboxId, timeoutMillis, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. (asynchronously)
* Get the newest email in an inbox or wait for one to arrive
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @param timeoutMillis Timeout milliseconds to wait for latest email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getLatestEmailInInboxAsync(UUID inboxId, Long timeoutMillis, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = getLatestEmailInInboxValidateBeforeCall(inboxId, timeoutMillis, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getOrganizationInboxes
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getOrganizationInboxesCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/organization";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getOrganizationInboxesValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getOrganizationInboxesCall(page, size, sort, searchFilter, since, before, _callback);
}
/**
* List Organization Inboxes Paginated
* List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time).
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @return PageOrganizationInboxProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageOrganizationInboxProjection getOrganizationInboxes(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageOrganizationInboxProjection> localVarResp = getOrganizationInboxesWithHttpInfo(page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* List Organization Inboxes Paginated
* List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time).
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @return ApiResponse<PageOrganizationInboxProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageOrganizationInboxProjection> getOrganizationInboxesWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getOrganizationInboxesValidateBeforeCall(page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageOrganizationInboxProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List Organization Inboxes Paginated (asynchronously)
* List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time).
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getOrganizationInboxesAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageOrganizationInboxProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getOrganizationInboxesValidateBeforeCall(page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageOrganizationInboxProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getScheduledJob
* @param jobId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getScheduledJobCall(UUID jobId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/scheduled-jobs/{jobId}"
.replace("{" + "jobId" + "}", localVarApiClient.escapeString(jobId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getScheduledJobValidateBeforeCall(UUID jobId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'jobId' is set
if (jobId == null) {
throw new ApiException("Missing the required parameter 'jobId' when calling getScheduledJob(Async)");
}
return getScheduledJobCall(jobId, _callback);
}
/**
* Get a scheduled email job
* Get a scheduled email job details.
* @param jobId (required)
* @return ScheduledJobDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ScheduledJobDto getScheduledJob(UUID jobId) throws ApiException {
ApiResponse<ScheduledJobDto> localVarResp = getScheduledJobWithHttpInfo(jobId);
return localVarResp.getData();
}
/**
* Get a scheduled email job
* Get a scheduled email job details.
* @param jobId (required)
* @return ApiResponse<ScheduledJobDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ScheduledJobDto> getScheduledJobWithHttpInfo(UUID jobId) throws ApiException {
okhttp3.Call localVarCall = getScheduledJobValidateBeforeCall(jobId, null);
Type localVarReturnType = new TypeToken<ScheduledJobDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a scheduled email job (asynchronously)
* Get a scheduled email job details.
* @param jobId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getScheduledJobAsync(UUID jobId, final ApiCallback<ScheduledJobDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getScheduledJobValidateBeforeCall(jobId, _callback);
Type localVarReturnType = new TypeToken<ScheduledJobDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getScheduledJobsByInboxId
* @param inboxId (required)
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getScheduledJobsByInboxIdCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/scheduled-jobs"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getScheduledJobsByInboxIdValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getScheduledJobsByInboxId(Async)");
}
return getScheduledJobsByInboxIdCall(inboxId, page, size, sort, since, before, _callback);
}
/**
* Get all scheduled email sending jobs for the inbox
* Schedule sending of emails using scheduled jobs.
* @param inboxId (required)
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageScheduledJobs
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageScheduledJobs getScheduledJobsByInboxId(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageScheduledJobs> localVarResp = getScheduledJobsByInboxIdWithHttpInfo(inboxId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get all scheduled email sending jobs for the inbox
* Schedule sending of emails using scheduled jobs.
* @param inboxId (required)
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageScheduledJobs>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageScheduledJobs> getScheduledJobsByInboxIdWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getScheduledJobsByInboxIdValidateBeforeCall(inboxId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageScheduledJobs>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all scheduled email sending jobs for the inbox (asynchronously)
* Schedule sending of emails using scheduled jobs.
* @param inboxId (required)
* @param page Optional page index in scheduled job list pagination (optional, default to 0)
* @param size Optional page size in scheduled job list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getScheduledJobsByInboxIdAsync(UUID inboxId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageScheduledJobs> _callback) throws ApiException {
okhttp3.Call localVarCall = getScheduledJobsByInboxIdValidateBeforeCall(inboxId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageScheduledJobs>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listInboxRulesets
* @param inboxId (required)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listInboxRulesetsCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/rulesets"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listInboxRulesetsValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling listInboxRulesets(Async)");
}
return listInboxRulesetsCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* List inbox rulesets
* List all rulesets attached to an inbox
* @param inboxId (required)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @return PageInboxRulesetDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageInboxRulesetDto listInboxRulesets(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageInboxRulesetDto> localVarResp = listInboxRulesetsWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* List inbox rulesets
* List all rulesets attached to an inbox
* @param inboxId (required)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @return ApiResponse<PageInboxRulesetDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageInboxRulesetDto> listInboxRulesetsWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = listInboxRulesetsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageInboxRulesetDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List inbox rulesets (asynchronously)
* List all rulesets attached to an inbox
* @param inboxId (required)
* @param page Optional page index in inbox ruleset list pagination (optional, default to 0)
* @param size Optional page size in inbox ruleset list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listInboxRulesetsAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageInboxRulesetDto> _callback) throws ApiException {
okhttp3.Call localVarCall = listInboxRulesetsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageInboxRulesetDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listInboxTrackingPixels
* @param inboxId (required)
* @param page Optional page index in inbox tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in inbox tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listInboxTrackingPixelsCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/tracking-pixels"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listInboxTrackingPixelsValidateBeforeCall(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling listInboxTrackingPixels(Async)");
}
return listInboxTrackingPixelsCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
}
/**
* List inbox tracking pixels
* List all tracking pixels sent from an inbox
* @param inboxId (required)
* @param page Optional page index in inbox tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in inbox tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @return PageTrackingPixelProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageTrackingPixelProjection listInboxTrackingPixels(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageTrackingPixelProjection> localVarResp = listInboxTrackingPixelsWithHttpInfo(inboxId, page, size, sort, searchFilter, since, before);
return localVarResp.getData();
}
/**
* List inbox tracking pixels
* List all tracking pixels sent from an inbox
* @param inboxId (required)
* @param page Optional page index in inbox tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in inbox tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @return ApiResponse<PageTrackingPixelProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageTrackingPixelProjection> listInboxTrackingPixelsWithHttpInfo(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = listInboxTrackingPixelsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List inbox tracking pixels (asynchronously)
* List all tracking pixels sent from an inbox
* @param inboxId (required)
* @param page Optional page index in inbox tracking pixel list pagination (optional, default to 0)
* @param size Optional page size in inbox tracking pixel list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param searchFilter Optional search filter (optional)
* @param since Optional filter by created after given date time (optional)
* @param before Optional filter by created before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listInboxTrackingPixelsAsync(UUID inboxId, Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageTrackingPixelProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = listInboxTrackingPixelsValidateBeforeCall(inboxId, page, size, sort, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageTrackingPixelProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for sendEmail
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailCall(UUID inboxId, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendEmailOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendEmailValidateBeforeCall(UUID inboxId, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling sendEmail(Async)");
}
// verify the required parameter 'sendEmailOptions' is set
if (sendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'sendEmailOptions' when calling sendEmail(Async)");
}
return sendEmailCall(inboxId, sendEmailOptions, _callback);
}
/**
* Send Email
* Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public void sendEmail(UUID inboxId, SendEmailOptions sendEmailOptions) throws ApiException {
sendEmailWithHttpInfo(inboxId, sendEmailOptions);
}
/**
* Send Email
* Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> sendEmailWithHttpInfo(UUID inboxId, SendEmailOptions sendEmailOptions) throws ApiException {
okhttp3.Call localVarCall = sendEmailValidateBeforeCall(inboxId, sendEmailOptions, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Send Email (asynchronously)
* Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailAsync(UUID inboxId, SendEmailOptions sendEmailOptions, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = sendEmailValidateBeforeCall(inboxId, sendEmailOptions, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for sendEmailAndConfirm
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailAndConfirmCall(UUID inboxId, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendEmailOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/confirm"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendEmailAndConfirmValidateBeforeCall(UUID inboxId, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling sendEmailAndConfirm(Async)");
}
// verify the required parameter 'sendEmailOptions' is set
if (sendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'sendEmailOptions' when calling sendEmailAndConfirm(Async)");
}
return sendEmailAndConfirmCall(inboxId, sendEmailOptions, _callback);
}
/**
* Send email and return sent confirmation
* Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public SentEmailDto sendEmailAndConfirm(UUID inboxId, SendEmailOptions sendEmailOptions) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = sendEmailAndConfirmWithHttpInfo(inboxId, sendEmailOptions);
return localVarResp.getData();
}
/**
* Send email and return sent confirmation
* Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> sendEmailAndConfirmWithHttpInfo(UUID inboxId, SendEmailOptions sendEmailOptions) throws ApiException {
okhttp3.Call localVarCall = sendEmailAndConfirmValidateBeforeCall(inboxId, sendEmailOptions, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Send email and return sent confirmation (asynchronously)
* Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailAndConfirmAsync(UUID inboxId, SendEmailOptions sendEmailOptions, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = sendEmailAndConfirmValidateBeforeCall(inboxId, sendEmailOptions, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for sendEmailWithQueue
* @param inboxId ID of the inbox you want to send the email from (required)
* @param validateBeforeEnqueue Validate before adding to queue (required)
* @param sendEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailWithQueueCall(UUID inboxId, Boolean validateBeforeEnqueue, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendEmailOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/with-queue"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (validateBeforeEnqueue != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("validateBeforeEnqueue", validateBeforeEnqueue));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendEmailWithQueueValidateBeforeCall(UUID inboxId, Boolean validateBeforeEnqueue, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling sendEmailWithQueue(Async)");
}
// verify the required parameter 'validateBeforeEnqueue' is set
if (validateBeforeEnqueue == null) {
throw new ApiException("Missing the required parameter 'validateBeforeEnqueue' when calling sendEmailWithQueue(Async)");
}
// verify the required parameter 'sendEmailOptions' is set
if (sendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'sendEmailOptions' when calling sendEmailWithQueue(Async)");
}
return sendEmailWithQueueCall(inboxId, validateBeforeEnqueue, sendEmailOptions, _callback);
}
/**
* Send email with queue
* Send an email using a queue. Will place the email onto a queue that will then be processed and sent. Use this queue method to enable any failed email sending to be recovered. This will prevent lost emails when sending if your account encounters a block or payment issue.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param validateBeforeEnqueue Validate before adding to queue (required)
* @param sendEmailOptions (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public void sendEmailWithQueue(UUID inboxId, Boolean validateBeforeEnqueue, SendEmailOptions sendEmailOptions) throws ApiException {
sendEmailWithQueueWithHttpInfo(inboxId, validateBeforeEnqueue, sendEmailOptions);
}
/**
* Send email with queue
* Send an email using a queue. Will place the email onto a queue that will then be processed and sent. Use this queue method to enable any failed email sending to be recovered. This will prevent lost emails when sending if your account encounters a block or payment issue.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param validateBeforeEnqueue Validate before adding to queue (required)
* @param sendEmailOptions (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> sendEmailWithQueueWithHttpInfo(UUID inboxId, Boolean validateBeforeEnqueue, SendEmailOptions sendEmailOptions) throws ApiException {
okhttp3.Call localVarCall = sendEmailWithQueueValidateBeforeCall(inboxId, validateBeforeEnqueue, sendEmailOptions, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Send email with queue (asynchronously)
* Send an email using a queue. Will place the email onto a queue that will then be processed and sent. Use this queue method to enable any failed email sending to be recovered. This will prevent lost emails when sending if your account encounters a block or payment issue.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param validateBeforeEnqueue Validate before adding to queue (required)
* @param sendEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailWithQueueAsync(UUID inboxId, Boolean validateBeforeEnqueue, SendEmailOptions sendEmailOptions, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = sendEmailWithQueueValidateBeforeCall(inboxId, validateBeforeEnqueue, sendEmailOptions, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for sendSmtpEnvelope
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendSMTPEnvelopeOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendSmtpEnvelopeCall(UUID inboxId, SendSMTPEnvelopeOptions sendSMTPEnvelopeOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendSMTPEnvelopeOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/smtp-envelope"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendSmtpEnvelopeValidateBeforeCall(UUID inboxId, SendSMTPEnvelopeOptions sendSMTPEnvelopeOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling sendSmtpEnvelope(Async)");
}
// verify the required parameter 'sendSMTPEnvelopeOptions' is set
if (sendSMTPEnvelopeOptions == null) {
throw new ApiException("Missing the required parameter 'sendSMTPEnvelopeOptions' when calling sendSmtpEnvelope(Async)");
}
return sendSmtpEnvelopeCall(inboxId, sendSMTPEnvelopeOptions, _callback);
}
/**
* Send email using an SMTP mail envelope and message body and return sent confirmation
* Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendSMTPEnvelopeOptions (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public SentEmailDto sendSmtpEnvelope(UUID inboxId, SendSMTPEnvelopeOptions sendSMTPEnvelopeOptions) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = sendSmtpEnvelopeWithHttpInfo(inboxId, sendSMTPEnvelopeOptions);
return localVarResp.getData();
}
/**
* Send email using an SMTP mail envelope and message body and return sent confirmation
* Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendSMTPEnvelopeOptions (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> sendSmtpEnvelopeWithHttpInfo(UUID inboxId, SendSMTPEnvelopeOptions sendSMTPEnvelopeOptions) throws ApiException {
okhttp3.Call localVarCall = sendSmtpEnvelopeValidateBeforeCall(inboxId, sendSMTPEnvelopeOptions, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Send email using an SMTP mail envelope and message body and return sent confirmation (asynchronously)
* Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendSMTPEnvelopeOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendSmtpEnvelopeAsync(UUID inboxId, SendSMTPEnvelopeOptions sendSMTPEnvelopeOptions, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = sendSmtpEnvelopeValidateBeforeCall(inboxId, sendSMTPEnvelopeOptions, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for sendTestEmail
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendTestEmailCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/send-test-email"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendTestEmailValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling sendTestEmail(Async)");
}
return sendTestEmailCall(inboxId, _callback);
}
/**
* Send a test email to inbox
* Send an inbox a test email to test email receiving is working
* @param inboxId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void sendTestEmail(UUID inboxId) throws ApiException {
sendTestEmailWithHttpInfo(inboxId);
}
/**
* Send a test email to inbox
* Send an inbox a test email to test email receiving is working
* @param inboxId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> sendTestEmailWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = sendTestEmailValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Send a test email to inbox (asynchronously)
* Send an inbox a test email to test email receiving is working
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendTestEmailAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = sendTestEmailValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for sendWithSchedule
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param sendAtTimestamp Sending timestamp (optional)
* @param sendAtNowPlusSeconds Send after n seconds (optional)
* @param validateBeforeEnqueue Validate before adding to queue (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendWithScheduleCall(UUID inboxId, SendEmailOptions sendEmailOptions, OffsetDateTime sendAtTimestamp, Long sendAtNowPlusSeconds, Boolean validateBeforeEnqueue, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendEmailOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/with-schedule"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (sendAtTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendAtTimestamp", sendAtTimestamp));
}
if (sendAtNowPlusSeconds != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendAtNowPlusSeconds", sendAtNowPlusSeconds));
}
if (validateBeforeEnqueue != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("validateBeforeEnqueue", validateBeforeEnqueue));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendWithScheduleValidateBeforeCall(UUID inboxId, SendEmailOptions sendEmailOptions, OffsetDateTime sendAtTimestamp, Long sendAtNowPlusSeconds, Boolean validateBeforeEnqueue, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling sendWithSchedule(Async)");
}
// verify the required parameter 'sendEmailOptions' is set
if (sendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'sendEmailOptions' when calling sendWithSchedule(Async)");
}
return sendWithScheduleCall(inboxId, sendEmailOptions, sendAtTimestamp, sendAtNowPlusSeconds, validateBeforeEnqueue, _callback);
}
/**
* Send email with with delay or schedule
* Send an email using a delay. Will place the email onto a scheduler that will then be processed and sent. Use delays to schedule email sending.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param sendAtTimestamp Sending timestamp (optional)
* @param sendAtNowPlusSeconds Send after n seconds (optional)
* @param validateBeforeEnqueue Validate before adding to queue (optional)
* @return ScheduledJobDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ScheduledJobDto sendWithSchedule(UUID inboxId, SendEmailOptions sendEmailOptions, OffsetDateTime sendAtTimestamp, Long sendAtNowPlusSeconds, Boolean validateBeforeEnqueue) throws ApiException {
ApiResponse<ScheduledJobDto> localVarResp = sendWithScheduleWithHttpInfo(inboxId, sendEmailOptions, sendAtTimestamp, sendAtNowPlusSeconds, validateBeforeEnqueue);
return localVarResp.getData();
}
/**
* Send email with with delay or schedule
* Send an email using a delay. Will place the email onto a scheduler that will then be processed and sent. Use delays to schedule email sending.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param sendAtTimestamp Sending timestamp (optional)
* @param sendAtNowPlusSeconds Send after n seconds (optional)
* @param validateBeforeEnqueue Validate before adding to queue (optional)
* @return ApiResponse<ScheduledJobDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<ScheduledJobDto> sendWithScheduleWithHttpInfo(UUID inboxId, SendEmailOptions sendEmailOptions, OffsetDateTime sendAtTimestamp, Long sendAtNowPlusSeconds, Boolean validateBeforeEnqueue) throws ApiException {
okhttp3.Call localVarCall = sendWithScheduleValidateBeforeCall(inboxId, sendEmailOptions, sendAtTimestamp, sendAtNowPlusSeconds, validateBeforeEnqueue, null);
Type localVarReturnType = new TypeToken<ScheduledJobDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Send email with with delay or schedule (asynchronously)
* Send an email using a delay. Will place the email onto a scheduler that will then be processed and sent. Use delays to schedule email sending.
* @param inboxId ID of the inbox you want to send the email from (required)
* @param sendEmailOptions (required)
* @param sendAtTimestamp Sending timestamp (optional)
* @param sendAtNowPlusSeconds Send after n seconds (optional)
* @param validateBeforeEnqueue Validate before adding to queue (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendWithScheduleAsync(UUID inboxId, SendEmailOptions sendEmailOptions, OffsetDateTime sendAtTimestamp, Long sendAtNowPlusSeconds, Boolean validateBeforeEnqueue, final ApiCallback<ScheduledJobDto> _callback) throws ApiException {
okhttp3.Call localVarCall = sendWithScheduleValidateBeforeCall(inboxId, sendEmailOptions, sendAtTimestamp, sendAtNowPlusSeconds, validateBeforeEnqueue, _callback);
Type localVarReturnType = new TypeToken<ScheduledJobDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for setInboxFavourited
* @param inboxId ID of inbox to set favourite state (required)
* @param setInboxFavouritedOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call setInboxFavouritedCall(UUID inboxId, SetInboxFavouritedOptions setInboxFavouritedOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = setInboxFavouritedOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}/favourite"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call setInboxFavouritedValidateBeforeCall(UUID inboxId, SetInboxFavouritedOptions setInboxFavouritedOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling setInboxFavourited(Async)");
}
// verify the required parameter 'setInboxFavouritedOptions' is set
if (setInboxFavouritedOptions == null) {
throw new ApiException("Missing the required parameter 'setInboxFavouritedOptions' when calling setInboxFavourited(Async)");
}
return setInboxFavouritedCall(inboxId, setInboxFavouritedOptions, _callback);
}
/**
* Set inbox favourited state
* Set and return new favourite state for an inbox
* @param inboxId ID of inbox to set favourite state (required)
* @param setInboxFavouritedOptions (required)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxDto setInboxFavourited(UUID inboxId, SetInboxFavouritedOptions setInboxFavouritedOptions) throws ApiException {
ApiResponse<InboxDto> localVarResp = setInboxFavouritedWithHttpInfo(inboxId, setInboxFavouritedOptions);
return localVarResp.getData();
}
/**
* Set inbox favourited state
* Set and return new favourite state for an inbox
* @param inboxId ID of inbox to set favourite state (required)
* @param setInboxFavouritedOptions (required)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> setInboxFavouritedWithHttpInfo(UUID inboxId, SetInboxFavouritedOptions setInboxFavouritedOptions) throws ApiException {
okhttp3.Call localVarCall = setInboxFavouritedValidateBeforeCall(inboxId, setInboxFavouritedOptions, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Set inbox favourited state (asynchronously)
* Set and return new favourite state for an inbox
* @param inboxId ID of inbox to set favourite state (required)
* @param setInboxFavouritedOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call setInboxFavouritedAsync(UUID inboxId, SetInboxFavouritedOptions setInboxFavouritedOptions, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = setInboxFavouritedValidateBeforeCall(inboxId, setInboxFavouritedOptions, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateInbox
* @param inboxId (required)
* @param updateInboxOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateInboxCall(UUID inboxId, UpdateInboxOptions updateInboxOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateInboxOptions;
// create path and map variables
String localVarPath = "/inboxes/{inboxId}"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateInboxValidateBeforeCall(UUID inboxId, UpdateInboxOptions updateInboxOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling updateInbox(Async)");
}
// verify the required parameter 'updateInboxOptions' is set
if (updateInboxOptions == null) {
throw new ApiException("Missing the required parameter 'updateInboxOptions' when calling updateInbox(Async)");
}
return updateInboxCall(inboxId, updateInboxOptions, _callback);
}
/**
* Update Inbox. Change name and description. Email address is not editable.
* Update editable fields on an inbox
* @param inboxId (required)
* @param updateInboxOptions (required)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxDto updateInbox(UUID inboxId, UpdateInboxOptions updateInboxOptions) throws ApiException {
ApiResponse<InboxDto> localVarResp = updateInboxWithHttpInfo(inboxId, updateInboxOptions);
return localVarResp.getData();
}
/**
* Update Inbox. Change name and description. Email address is not editable.
* Update editable fields on an inbox
* @param inboxId (required)
* @param updateInboxOptions (required)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> updateInboxWithHttpInfo(UUID inboxId, UpdateInboxOptions updateInboxOptions) throws ApiException {
okhttp3.Call localVarCall = updateInboxValidateBeforeCall(inboxId, updateInboxOptions, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update Inbox. Change name and description. Email address is not editable. (asynchronously)
* Update editable fields on an inbox
* @param inboxId (required)
* @param updateInboxOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateInboxAsync(UUID inboxId, UpdateInboxOptions updateInboxOptions, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateInboxValidateBeforeCall(inboxId, updateInboxOptions, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateGroupOptions;
import com.mailslurp.models.GroupContactsDto;
import com.mailslurp.models.GroupDto;
import com.mailslurp.models.GroupProjection;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageContactProjection;
import com.mailslurp.models.PageGroupProjection;
import java.util.UUID;
import com.mailslurp.models.UpdateGroupContacts;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class GroupControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public GroupControllerApi() {
this(Configuration.getDefaultApiClient());
}
public GroupControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for addContactsToGroup
* @param groupId (required)
* @param updateGroupContacts (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call addContactsToGroupCall(UUID groupId, UpdateGroupContacts updateGroupContacts, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateGroupContacts;
// create path and map variables
String localVarPath = "/groups/{groupId}/contacts"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addContactsToGroupValidateBeforeCall(UUID groupId, UpdateGroupContacts updateGroupContacts, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling addContactsToGroup(Async)");
}
// verify the required parameter 'updateGroupContacts' is set
if (updateGroupContacts == null) {
throw new ApiException("Missing the required parameter 'updateGroupContacts' when calling addContactsToGroup(Async)");
}
return addContactsToGroupCall(groupId, updateGroupContacts, _callback);
}
/**
* Add contacts to a group
*
* @param groupId (required)
* @param updateGroupContacts (required)
* @return GroupContactsDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public GroupContactsDto addContactsToGroup(UUID groupId, UpdateGroupContacts updateGroupContacts) throws ApiException {
ApiResponse<GroupContactsDto> localVarResp = addContactsToGroupWithHttpInfo(groupId, updateGroupContacts);
return localVarResp.getData();
}
/**
* Add contacts to a group
*
* @param groupId (required)
* @param updateGroupContacts (required)
* @return ApiResponse<GroupContactsDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<GroupContactsDto> addContactsToGroupWithHttpInfo(UUID groupId, UpdateGroupContacts updateGroupContacts) throws ApiException {
okhttp3.Call localVarCall = addContactsToGroupValidateBeforeCall(groupId, updateGroupContacts, null);
Type localVarReturnType = new TypeToken<GroupContactsDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Add contacts to a group (asynchronously)
*
* @param groupId (required)
* @param updateGroupContacts (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call addContactsToGroupAsync(UUID groupId, UpdateGroupContacts updateGroupContacts, final ApiCallback<GroupContactsDto> _callback) throws ApiException {
okhttp3.Call localVarCall = addContactsToGroupValidateBeforeCall(groupId, updateGroupContacts, _callback);
Type localVarReturnType = new TypeToken<GroupContactsDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createGroup
* @param createGroupOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createGroupCall(CreateGroupOptions createGroupOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createGroupOptions;
// create path and map variables
String localVarPath = "/groups";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createGroupValidateBeforeCall(CreateGroupOptions createGroupOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createGroupOptions' is set
if (createGroupOptions == null) {
throw new ApiException("Missing the required parameter 'createGroupOptions' when calling createGroup(Async)");
}
return createGroupCall(createGroupOptions, _callback);
}
/**
* Create a group
*
* @param createGroupOptions (required)
* @return GroupDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public GroupDto createGroup(CreateGroupOptions createGroupOptions) throws ApiException {
ApiResponse<GroupDto> localVarResp = createGroupWithHttpInfo(createGroupOptions);
return localVarResp.getData();
}
/**
* Create a group
*
* @param createGroupOptions (required)
* @return ApiResponse<GroupDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<GroupDto> createGroupWithHttpInfo(CreateGroupOptions createGroupOptions) throws ApiException {
okhttp3.Call localVarCall = createGroupValidateBeforeCall(createGroupOptions, null);
Type localVarReturnType = new TypeToken<GroupDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a group (asynchronously)
*
* @param createGroupOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createGroupAsync(CreateGroupOptions createGroupOptions, final ApiCallback<GroupDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createGroupValidateBeforeCall(createGroupOptions, _callback);
Type localVarReturnType = new TypeToken<GroupDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteGroup
* @param groupId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteGroupCall(UUID groupId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/groups/{groupId}"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteGroupValidateBeforeCall(UUID groupId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling deleteGroup(Async)");
}
return deleteGroupCall(groupId, _callback);
}
/**
* Delete group
*
* @param groupId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteGroup(UUID groupId) throws ApiException {
deleteGroupWithHttpInfo(groupId);
}
/**
* Delete group
*
* @param groupId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteGroupWithHttpInfo(UUID groupId) throws ApiException {
okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete group (asynchronously)
*
* @param groupId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteGroupAsync(UUID groupId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllGroups
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllGroupsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/groups/paginated";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllGroupsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllGroupsCall(page, size, sort, since, before, _callback);
}
/**
* Get all Contact Groups in paginated format
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageGroupProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageGroupProjection getAllGroups(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageGroupProjection> localVarResp = getAllGroupsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get all Contact Groups in paginated format
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageGroupProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageGroupProjection> getAllGroupsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllGroupsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageGroupProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all Contact Groups in paginated format (asynchronously)
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllGroupsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageGroupProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllGroupsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageGroupProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getGroup
* @param groupId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupCall(UUID groupId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/groups/{groupId}"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getGroupValidateBeforeCall(UUID groupId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling getGroup(Async)");
}
return getGroupCall(groupId, _callback);
}
/**
* Get group
*
* @param groupId (required)
* @return GroupDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public GroupDto getGroup(UUID groupId) throws ApiException {
ApiResponse<GroupDto> localVarResp = getGroupWithHttpInfo(groupId);
return localVarResp.getData();
}
/**
* Get group
*
* @param groupId (required)
* @return ApiResponse<GroupDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<GroupDto> getGroupWithHttpInfo(UUID groupId) throws ApiException {
okhttp3.Call localVarCall = getGroupValidateBeforeCall(groupId, null);
Type localVarReturnType = new TypeToken<GroupDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get group (asynchronously)
*
* @param groupId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupAsync(UUID groupId, final ApiCallback<GroupDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getGroupValidateBeforeCall(groupId, _callback);
Type localVarReturnType = new TypeToken<GroupDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getGroupWithContacts
* @param groupId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupWithContactsCall(UUID groupId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/groups/{groupId}/contacts"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getGroupWithContactsValidateBeforeCall(UUID groupId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling getGroupWithContacts(Async)");
}
return getGroupWithContactsCall(groupId, _callback);
}
/**
* Get group and contacts belonging to it
*
* @param groupId (required)
* @return GroupContactsDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public GroupContactsDto getGroupWithContacts(UUID groupId) throws ApiException {
ApiResponse<GroupContactsDto> localVarResp = getGroupWithContactsWithHttpInfo(groupId);
return localVarResp.getData();
}
/**
* Get group and contacts belonging to it
*
* @param groupId (required)
* @return ApiResponse<GroupContactsDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<GroupContactsDto> getGroupWithContactsWithHttpInfo(UUID groupId) throws ApiException {
okhttp3.Call localVarCall = getGroupWithContactsValidateBeforeCall(groupId, null);
Type localVarReturnType = new TypeToken<GroupContactsDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get group and contacts belonging to it (asynchronously)
*
* @param groupId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupWithContactsAsync(UUID groupId, final ApiCallback<GroupContactsDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getGroupWithContactsValidateBeforeCall(groupId, _callback);
Type localVarReturnType = new TypeToken<GroupContactsDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getGroupWithContactsPaginated
* @param groupId (required)
* @param page Optional page index in group contact pagination (optional, default to 0)
* @param size Optional page size in group contact pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupWithContactsPaginatedCall(UUID groupId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/groups/{groupId}/contacts-paginated"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getGroupWithContactsPaginatedValidateBeforeCall(UUID groupId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling getGroupWithContactsPaginated(Async)");
}
return getGroupWithContactsPaginatedCall(groupId, page, size, sort, since, before, _callback);
}
/**
*
* Get group and paginated contacts belonging to it
* @param groupId (required)
* @param page Optional page index in group contact pagination (optional, default to 0)
* @param size Optional page size in group contact pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageContactProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageContactProjection getGroupWithContactsPaginated(UUID groupId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageContactProjection> localVarResp = getGroupWithContactsPaginatedWithHttpInfo(groupId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
*
* Get group and paginated contacts belonging to it
* @param groupId (required)
* @param page Optional page index in group contact pagination (optional, default to 0)
* @param size Optional page size in group contact pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageContactProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageContactProjection> getGroupWithContactsPaginatedWithHttpInfo(UUID groupId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getGroupWithContactsPaginatedValidateBeforeCall(groupId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageContactProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get group and paginated contacts belonging to it
* @param groupId (required)
* @param page Optional page index in group contact pagination (optional, default to 0)
* @param size Optional page size in group contact pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupWithContactsPaginatedAsync(UUID groupId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageContactProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getGroupWithContactsPaginatedValidateBeforeCall(groupId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageContactProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getGroups
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/groups";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getGroupsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getGroupsCall(_callback);
}
/**
* Get all groups
*
* @return List<GroupProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<GroupProjection> getGroups() throws ApiException {
ApiResponse<List<GroupProjection>> localVarResp = getGroupsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get all groups
*
* @return ApiResponse<List<GroupProjection>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<GroupProjection>> getGroupsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getGroupsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<GroupProjection>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all groups (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGroupsAsync(final ApiCallback<List<GroupProjection>> _callback) throws ApiException {
okhttp3.Call localVarCall = getGroupsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<GroupProjection>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for removeContactsFromGroup
* @param groupId (required)
* @param updateGroupContacts (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call removeContactsFromGroupCall(UUID groupId, UpdateGroupContacts updateGroupContacts, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateGroupContacts;
// create path and map variables
String localVarPath = "/groups/{groupId}/contacts"
.replace("{" + "groupId" + "}", localVarApiClient.escapeString(groupId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call removeContactsFromGroupValidateBeforeCall(UUID groupId, UpdateGroupContacts updateGroupContacts, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'groupId' is set
if (groupId == null) {
throw new ApiException("Missing the required parameter 'groupId' when calling removeContactsFromGroup(Async)");
}
// verify the required parameter 'updateGroupContacts' is set
if (updateGroupContacts == null) {
throw new ApiException("Missing the required parameter 'updateGroupContacts' when calling removeContactsFromGroup(Async)");
}
return removeContactsFromGroupCall(groupId, updateGroupContacts, _callback);
}
/**
* Remove contacts from a group
*
* @param groupId (required)
* @param updateGroupContacts (required)
* @return GroupContactsDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public GroupContactsDto removeContactsFromGroup(UUID groupId, UpdateGroupContacts updateGroupContacts) throws ApiException {
ApiResponse<GroupContactsDto> localVarResp = removeContactsFromGroupWithHttpInfo(groupId, updateGroupContacts);
return localVarResp.getData();
}
/**
* Remove contacts from a group
*
* @param groupId (required)
* @param updateGroupContacts (required)
* @return ApiResponse<GroupContactsDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<GroupContactsDto> removeContactsFromGroupWithHttpInfo(UUID groupId, UpdateGroupContacts updateGroupContacts) throws ApiException {
okhttp3.Call localVarCall = removeContactsFromGroupValidateBeforeCall(groupId, updateGroupContacts, null);
Type localVarReturnType = new TypeToken<GroupContactsDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Remove contacts from a group (asynchronously)
*
* @param groupId (required)
* @param updateGroupContacts (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call removeContactsFromGroupAsync(UUID groupId, UpdateGroupContacts updateGroupContacts, final ApiCallback<GroupContactsDto> _callback) throws ApiException {
okhttp3.Call localVarCall = removeContactsFromGroupValidateBeforeCall(groupId, updateGroupContacts, _callback);
Type localVarReturnType = new TypeToken<GroupContactsDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class FormControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public FormControllerApi() {
this(Configuration.getDefaultApiClient());
}
public FormControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for submitForm
* @param to The email address that submitted form should be sent to. (optional)
* @param subject Optional subject of the email that will be sent. (optional)
* @param redirectTo Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional)
* @param emailAddress Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional)
* @param successMessage Optional success message to display if no _redirectTo present. (optional)
* @param spamCheck Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional)
* @param otherParameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call submitFormCall(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forms";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (to != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("_to", to));
}
if (subject != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("_subject", subject));
}
if (redirectTo != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("_redirectTo", redirectTo));
}
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("_emailAddress", emailAddress));
}
if (successMessage != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("_successMessage", successMessage));
}
if (spamCheck != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("_spamCheck", spamCheck));
}
if (otherParameters != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("otherParameters", otherParameters));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call submitFormValidateBeforeCall(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters, final ApiCallback _callback) throws ApiException {
return submitFormCall(to, subject, redirectTo, emailAddress, successMessage, spamCheck, otherParameters, _callback);
}
/**
* Submit a form to be parsed and sent as an email to an address determined by the form fields
* This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://java.api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://java.api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
* @param to The email address that submitted form should be sent to. (optional)
* @param subject Optional subject of the email that will be sent. (optional)
* @param redirectTo Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional)
* @param emailAddress Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional)
* @param successMessage Optional success message to display if no _redirectTo present. (optional)
* @param spamCheck Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional)
* @param otherParameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String submitForm(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters) throws ApiException {
ApiResponse<String> localVarResp = submitFormWithHttpInfo(to, subject, redirectTo, emailAddress, successMessage, spamCheck, otherParameters);
return localVarResp.getData();
}
/**
* Submit a form to be parsed and sent as an email to an address determined by the form fields
* This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://java.api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://java.api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
* @param to The email address that submitted form should be sent to. (optional)
* @param subject Optional subject of the email that will be sent. (optional)
* @param redirectTo Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional)
* @param emailAddress Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional)
* @param successMessage Optional success message to display if no _redirectTo present. (optional)
* @param spamCheck Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional)
* @param otherParameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> submitFormWithHttpInfo(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters) throws ApiException {
okhttp3.Call localVarCall = submitFormValidateBeforeCall(to, subject, redirectTo, emailAddress, successMessage, spamCheck, otherParameters, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Submit a form to be parsed and sent as an email to an address determined by the form fields (asynchronously)
* This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://java.api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://java.api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
* @param to The email address that submitted form should be sent to. (optional)
* @param subject Optional subject of the email that will be sent. (optional)
* @param redirectTo Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional)
* @param emailAddress Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional)
* @param successMessage Optional success message to display if no _redirectTo present. (optional)
* @param spamCheck Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional)
* @param otherParameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call submitFormAsync(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = submitFormValidateBeforeCall(to, subject, redirectTo, emailAddress, successMessage, spamCheck, otherParameters, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.ExportLink;
import com.mailslurp.models.ExportOptions;
import java.time.OffsetDateTime;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class ExportControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ExportControllerApi() {
this(Configuration.getDefaultApiClient());
}
public ExportControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for exportEntities
* @param exportType (required)
* @param apiKey (required)
* @param outputFormat (required)
* @param filter (optional)
* @param listSeparatorToken (optional)
* @param excludePreviouslyExported (optional)
* @param createdEarliestTime (optional)
* @param createdOldestTime (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call exportEntitiesCall(String exportType, String apiKey, String outputFormat, String filter, String listSeparatorToken, Boolean excludePreviouslyExported, OffsetDateTime createdEarliestTime, OffsetDateTime createdOldestTime, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/export";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (exportType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("exportType", exportType));
}
if (apiKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("apiKey", apiKey));
}
if (outputFormat != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("outputFormat", outputFormat));
}
if (filter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter));
}
if (listSeparatorToken != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("listSeparatorToken", listSeparatorToken));
}
if (excludePreviouslyExported != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("excludePreviouslyExported", excludePreviouslyExported));
}
if (createdEarliestTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("createdEarliestTime", createdEarliestTime));
}
if (createdOldestTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("createdOldestTime", createdOldestTime));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call exportEntitiesValidateBeforeCall(String exportType, String apiKey, String outputFormat, String filter, String listSeparatorToken, Boolean excludePreviouslyExported, OffsetDateTime createdEarliestTime, OffsetDateTime createdOldestTime, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'exportType' is set
if (exportType == null) {
throw new ApiException("Missing the required parameter 'exportType' when calling exportEntities(Async)");
}
// verify the required parameter 'apiKey' is set
if (apiKey == null) {
throw new ApiException("Missing the required parameter 'apiKey' when calling exportEntities(Async)");
}
// verify the required parameter 'outputFormat' is set
if (outputFormat == null) {
throw new ApiException("Missing the required parameter 'outputFormat' when calling exportEntities(Async)");
}
return exportEntitiesCall(exportType, apiKey, outputFormat, filter, listSeparatorToken, excludePreviouslyExported, createdEarliestTime, createdOldestTime, _callback);
}
/**
* Export inboxes link callable via browser
*
* @param exportType (required)
* @param apiKey (required)
* @param outputFormat (required)
* @param filter (optional)
* @param listSeparatorToken (optional)
* @param excludePreviouslyExported (optional)
* @param createdEarliestTime (optional)
* @param createdOldestTime (optional)
* @return List<byte[]>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<byte[]> exportEntities(String exportType, String apiKey, String outputFormat, String filter, String listSeparatorToken, Boolean excludePreviouslyExported, OffsetDateTime createdEarliestTime, OffsetDateTime createdOldestTime) throws ApiException {
ApiResponse<List<byte[]>> localVarResp = exportEntitiesWithHttpInfo(exportType, apiKey, outputFormat, filter, listSeparatorToken, excludePreviouslyExported, createdEarliestTime, createdOldestTime);
return localVarResp.getData();
}
/**
* Export inboxes link callable via browser
*
* @param exportType (required)
* @param apiKey (required)
* @param outputFormat (required)
* @param filter (optional)
* @param listSeparatorToken (optional)
* @param excludePreviouslyExported (optional)
* @param createdEarliestTime (optional)
* @param createdOldestTime (optional)
* @return ApiResponse<List<byte[]>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<byte[]>> exportEntitiesWithHttpInfo(String exportType, String apiKey, String outputFormat, String filter, String listSeparatorToken, Boolean excludePreviouslyExported, OffsetDateTime createdEarliestTime, OffsetDateTime createdOldestTime) throws ApiException {
okhttp3.Call localVarCall = exportEntitiesValidateBeforeCall(exportType, apiKey, outputFormat, filter, listSeparatorToken, excludePreviouslyExported, createdEarliestTime, createdOldestTime, null);
Type localVarReturnType = new TypeToken<List<byte[]>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Export inboxes link callable via browser (asynchronously)
*
* @param exportType (required)
* @param apiKey (required)
* @param outputFormat (required)
* @param filter (optional)
* @param listSeparatorToken (optional)
* @param excludePreviouslyExported (optional)
* @param createdEarliestTime (optional)
* @param createdOldestTime (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call exportEntitiesAsync(String exportType, String apiKey, String outputFormat, String filter, String listSeparatorToken, Boolean excludePreviouslyExported, OffsetDateTime createdEarliestTime, OffsetDateTime createdOldestTime, final ApiCallback<List<byte[]>> _callback) throws ApiException {
okhttp3.Call localVarCall = exportEntitiesValidateBeforeCall(exportType, apiKey, outputFormat, filter, listSeparatorToken, excludePreviouslyExported, createdEarliestTime, createdOldestTime, _callback);
Type localVarReturnType = new TypeToken<List<byte[]>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getExportLink
* @param exportType (required)
* @param exportOptions (required)
* @param apiKey (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExportLinkCall(String exportType, ExportOptions exportOptions, String apiKey, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = exportOptions;
// create path and map variables
String localVarPath = "/export";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (exportType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("exportType", exportType));
}
if (apiKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("apiKey", apiKey));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getExportLinkValidateBeforeCall(String exportType, ExportOptions exportOptions, String apiKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'exportType' is set
if (exportType == null) {
throw new ApiException("Missing the required parameter 'exportType' when calling getExportLink(Async)");
}
// verify the required parameter 'exportOptions' is set
if (exportOptions == null) {
throw new ApiException("Missing the required parameter 'exportOptions' when calling getExportLink(Async)");
}
return getExportLinkCall(exportType, exportOptions, apiKey, _callback);
}
/**
* Get export link
*
* @param exportType (required)
* @param exportOptions (required)
* @param apiKey (optional)
* @return ExportLink
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ExportLink getExportLink(String exportType, ExportOptions exportOptions, String apiKey) throws ApiException {
ApiResponse<ExportLink> localVarResp = getExportLinkWithHttpInfo(exportType, exportOptions, apiKey);
return localVarResp.getData();
}
/**
* Get export link
*
* @param exportType (required)
* @param exportOptions (required)
* @param apiKey (optional)
* @return ApiResponse<ExportLink>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ExportLink> getExportLinkWithHttpInfo(String exportType, ExportOptions exportOptions, String apiKey) throws ApiException {
okhttp3.Call localVarCall = getExportLinkValidateBeforeCall(exportType, exportOptions, apiKey, null);
Type localVarReturnType = new TypeToken<ExportLink>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get export link (asynchronously)
*
* @param exportType (required)
* @param exportOptions (required)
* @param apiKey (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExportLinkAsync(String exportType, ExportOptions exportOptions, String apiKey, final ApiCallback<ExportLink> _callback) throws ApiException {
okhttp3.Call localVarCall = getExportLinkValidateBeforeCall(exportType, exportOptions, apiKey, _callback);
Type localVarReturnType = new TypeToken<ExportLink>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.ExpirationDefaults;
import com.mailslurp.models.ExpiredInboxDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageExpiredInboxRecordProjection;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class ExpiredControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ExpiredControllerApi() {
this(Configuration.getDefaultApiClient());
}
public ExpiredControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for getExpirationDefaults
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpirationDefaultsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/expired/defaults";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getExpirationDefaultsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getExpirationDefaultsCall(_callback);
}
/**
* Get default expiration settings
* Return default times used for inbox expiration
* @return ExpirationDefaults
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ExpirationDefaults getExpirationDefaults() throws ApiException {
ApiResponse<ExpirationDefaults> localVarResp = getExpirationDefaultsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get default expiration settings
* Return default times used for inbox expiration
* @return ApiResponse<ExpirationDefaults>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ExpirationDefaults> getExpirationDefaultsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getExpirationDefaultsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<ExpirationDefaults>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get default expiration settings (asynchronously)
* Return default times used for inbox expiration
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpirationDefaultsAsync(final ApiCallback<ExpirationDefaults> _callback) throws ApiException {
okhttp3.Call localVarCall = getExpirationDefaultsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<ExpirationDefaults>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getExpiredInboxByInboxId
* @param inboxId ID of inbox you want to retrieve (not the inbox ID) (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpiredInboxByInboxIdCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/expired/inbox/{inboxId}"
.replace("{" + "inboxId" + "}", localVarApiClient.escapeString(inboxId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getExpiredInboxByInboxIdValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getExpiredInboxByInboxId(Async)");
}
return getExpiredInboxByInboxIdCall(inboxId, _callback);
}
/**
* Get expired inbox record for a previously existing inbox
* Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
* @param inboxId ID of inbox you want to retrieve (not the inbox ID) (required)
* @return ExpiredInboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ExpiredInboxDto getExpiredInboxByInboxId(UUID inboxId) throws ApiException {
ApiResponse<ExpiredInboxDto> localVarResp = getExpiredInboxByInboxIdWithHttpInfo(inboxId);
return localVarResp.getData();
}
/**
* Get expired inbox record for a previously existing inbox
* Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
* @param inboxId ID of inbox you want to retrieve (not the inbox ID) (required)
* @return ApiResponse<ExpiredInboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ExpiredInboxDto> getExpiredInboxByInboxIdWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getExpiredInboxByInboxIdValidateBeforeCall(inboxId, null);
Type localVarReturnType = new TypeToken<ExpiredInboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get expired inbox record for a previously existing inbox (asynchronously)
* Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
* @param inboxId ID of inbox you want to retrieve (not the inbox ID) (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpiredInboxByInboxIdAsync(UUID inboxId, final ApiCallback<ExpiredInboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getExpiredInboxByInboxIdValidateBeforeCall(inboxId, _callback);
Type localVarReturnType = new TypeToken<ExpiredInboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getExpiredInboxRecord
* @param expiredId ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpiredInboxRecordCall(UUID expiredId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/expired/{expiredId}"
.replace("{" + "expiredId" + "}", localVarApiClient.escapeString(expiredId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getExpiredInboxRecordValidateBeforeCall(UUID expiredId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'expiredId' is set
if (expiredId == null) {
throw new ApiException("Missing the required parameter 'expiredId' when calling getExpiredInboxRecord(Async)");
}
return getExpiredInboxRecordCall(expiredId, _callback);
}
/**
* Get an expired inbox record
* Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
* @param expiredId ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId (required)
* @return ExpiredInboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ExpiredInboxDto getExpiredInboxRecord(UUID expiredId) throws ApiException {
ApiResponse<ExpiredInboxDto> localVarResp = getExpiredInboxRecordWithHttpInfo(expiredId);
return localVarResp.getData();
}
/**
* Get an expired inbox record
* Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
* @param expiredId ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId (required)
* @return ApiResponse<ExpiredInboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ExpiredInboxDto> getExpiredInboxRecordWithHttpInfo(UUID expiredId) throws ApiException {
okhttp3.Call localVarCall = getExpiredInboxRecordValidateBeforeCall(expiredId, null);
Type localVarReturnType = new TypeToken<ExpiredInboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an expired inbox record (asynchronously)
* Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
* @param expiredId ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpiredInboxRecordAsync(UUID expiredId, final ApiCallback<ExpiredInboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getExpiredInboxRecordValidateBeforeCall(expiredId, _callback);
Type localVarReturnType = new TypeToken<ExpiredInboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getExpiredInboxes
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpiredInboxesCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/expired";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getExpiredInboxesValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getExpiredInboxesCall(page, size, sort, since, before, _callback);
}
/**
* List records of expired inboxes
* Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageExpiredInboxRecordProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageExpiredInboxRecordProjection getExpiredInboxes(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageExpiredInboxRecordProjection> localVarResp = getExpiredInboxesWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* List records of expired inboxes
* Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageExpiredInboxRecordProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageExpiredInboxRecordProjection> getExpiredInboxesWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getExpiredInboxesValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageExpiredInboxRecordProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List records of expired inboxes (asynchronously)
* Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
* @param page Optional page index in inbox sent email list pagination (optional, default to 0)
* @param size Optional page size in inbox sent email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getExpiredInboxesAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageExpiredInboxRecordProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getExpiredInboxesValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageExpiredInboxRecordProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageEmailValidationRequest;
import com.mailslurp.models.ValidateEmailAddressListOptions;
import com.mailslurp.models.ValidateEmailAddressListResult;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class EmailVerificationControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public EmailVerificationControllerApi() {
this(Configuration.getDefaultApiClient());
}
public EmailVerificationControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for getValidationRequests
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param isValid Filter where email is valid is true or false (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getValidationRequestsCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean isValid, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email-verification/validation-requests";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (isValid != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("isValid", isValid));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getValidationRequestsValidateBeforeCall(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean isValid, final ApiCallback _callback) throws ApiException {
return getValidationRequestsCall(page, size, sort, searchFilter, since, before, isValid, _callback);
}
/**
* Validate a list of email addresses. Per unit billing. See your plan for pricing.
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param isValid Filter where email is valid is true or false (optional)
* @return PageEmailValidationRequest
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageEmailValidationRequest getValidationRequests(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean isValid) throws ApiException {
ApiResponse<PageEmailValidationRequest> localVarResp = getValidationRequestsWithHttpInfo(page, size, sort, searchFilter, since, before, isValid);
return localVarResp.getData();
}
/**
* Validate a list of email addresses. Per unit billing. See your plan for pricing.
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param isValid Filter where email is valid is true or false (optional)
* @return ApiResponse<PageEmailValidationRequest>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageEmailValidationRequest> getValidationRequestsWithHttpInfo(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean isValid) throws ApiException {
okhttp3.Call localVarCall = getValidationRequestsValidateBeforeCall(page, size, sort, searchFilter, since, before, isValid, null);
Type localVarReturnType = new TypeToken<PageEmailValidationRequest>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Validate a list of email addresses. Per unit billing. See your plan for pricing. (asynchronously)
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size for paginated result list. (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to DESC)
* @param searchFilter Optional search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param isValid Filter where email is valid is true or false (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getValidationRequestsAsync(Integer page, Integer size, String sort, String searchFilter, OffsetDateTime since, OffsetDateTime before, Boolean isValid, final ApiCallback<PageEmailValidationRequest> _callback) throws ApiException {
okhttp3.Call localVarCall = getValidationRequestsValidateBeforeCall(page, size, sort, searchFilter, since, before, isValid, _callback);
Type localVarReturnType = new TypeToken<PageEmailValidationRequest>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for validateEmailAddressList
* @param validateEmailAddressListOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call validateEmailAddressListCall(ValidateEmailAddressListOptions validateEmailAddressListOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = validateEmailAddressListOptions;
// create path and map variables
String localVarPath = "/email-verification/email-address-list";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call validateEmailAddressListValidateBeforeCall(ValidateEmailAddressListOptions validateEmailAddressListOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'validateEmailAddressListOptions' is set
if (validateEmailAddressListOptions == null) {
throw new ApiException("Missing the required parameter 'validateEmailAddressListOptions' when calling validateEmailAddressList(Async)");
}
return validateEmailAddressListCall(validateEmailAddressListOptions, _callback);
}
/**
* Validate a list of email addresses. Per unit billing. See your plan for pricing.
*
* @param validateEmailAddressListOptions (required)
* @return ValidateEmailAddressListResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ValidateEmailAddressListResult validateEmailAddressList(ValidateEmailAddressListOptions validateEmailAddressListOptions) throws ApiException {
ApiResponse<ValidateEmailAddressListResult> localVarResp = validateEmailAddressListWithHttpInfo(validateEmailAddressListOptions);
return localVarResp.getData();
}
/**
* Validate a list of email addresses. Per unit billing. See your plan for pricing.
*
* @param validateEmailAddressListOptions (required)
* @return ApiResponse<ValidateEmailAddressListResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ValidateEmailAddressListResult> validateEmailAddressListWithHttpInfo(ValidateEmailAddressListOptions validateEmailAddressListOptions) throws ApiException {
okhttp3.Call localVarCall = validateEmailAddressListValidateBeforeCall(validateEmailAddressListOptions, null);
Type localVarReturnType = new TypeToken<ValidateEmailAddressListResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Validate a list of email addresses. Per unit billing. See your plan for pricing. (asynchronously)
*
* @param validateEmailAddressListOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call validateEmailAddressListAsync(ValidateEmailAddressListOptions validateEmailAddressListOptions, final ApiCallback<ValidateEmailAddressListResult> _callback) throws ApiException {
okhttp3.Call localVarCall = validateEmailAddressListValidateBeforeCall(validateEmailAddressListOptions, _callback);
Type localVarReturnType = new TypeToken<ValidateEmailAddressListResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.AttachmentMetaData;
import com.mailslurp.models.ContentMatchOptions;
import com.mailslurp.models.CountDto;
import com.mailslurp.models.DownloadAttachmentDto;
import com.mailslurp.models.Email;
import com.mailslurp.models.EmailContentMatchResult;
import com.mailslurp.models.EmailHtmlDto;
import com.mailslurp.models.EmailLinksResult;
import com.mailslurp.models.EmailPreview;
import com.mailslurp.models.EmailPreviewUrls;
import com.mailslurp.models.EmailTextLinesResult;
import com.mailslurp.models.ForwardEmailOptions;
import com.mailslurp.models.GravatarUrl;
import com.mailslurp.models.ImapFlagOperationOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageEmailProjection;
import com.mailslurp.models.RawEmailJson;
import com.mailslurp.models.ReplyToEmailOptions;
import com.mailslurp.models.SendEmailOptions;
import com.mailslurp.models.SentEmailDto;
import java.util.UUID;
import com.mailslurp.models.UnreadCount;
import com.mailslurp.models.ValidationDto;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class EmailControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public EmailControllerApi() {
this(Configuration.getDefaultApiClient());
}
public EmailControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for applyImapFlagOperation
* @param emailId (required)
* @param imapFlagOperationOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call applyImapFlagOperationCall(UUID emailId, ImapFlagOperationOptions imapFlagOperationOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = imapFlagOperationOptions;
// create path and map variables
String localVarPath = "/emails/{emailId}/imap-flag-operation"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call applyImapFlagOperationValidateBeforeCall(UUID emailId, ImapFlagOperationOptions imapFlagOperationOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling applyImapFlagOperation(Async)");
}
// verify the required parameter 'imapFlagOperationOptions' is set
if (imapFlagOperationOptions == null) {
throw new ApiException("Missing the required parameter 'imapFlagOperationOptions' when calling applyImapFlagOperation(Async)");
}
return applyImapFlagOperationCall(emailId, imapFlagOperationOptions, _callback);
}
/**
* Set IMAP flags associated with a message. Only supports '\\Seen' flag.
* Apply RFC3501 section-2.3.2 IMAP flag operations on an email
* @param emailId (required)
* @param imapFlagOperationOptions (required)
* @return EmailPreview
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailPreview applyImapFlagOperation(UUID emailId, ImapFlagOperationOptions imapFlagOperationOptions) throws ApiException {
ApiResponse<EmailPreview> localVarResp = applyImapFlagOperationWithHttpInfo(emailId, imapFlagOperationOptions);
return localVarResp.getData();
}
/**
* Set IMAP flags associated with a message. Only supports '\\Seen' flag.
* Apply RFC3501 section-2.3.2 IMAP flag operations on an email
* @param emailId (required)
* @param imapFlagOperationOptions (required)
* @return ApiResponse<EmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailPreview> applyImapFlagOperationWithHttpInfo(UUID emailId, ImapFlagOperationOptions imapFlagOperationOptions) throws ApiException {
okhttp3.Call localVarCall = applyImapFlagOperationValidateBeforeCall(emailId, imapFlagOperationOptions, null);
Type localVarReturnType = new TypeToken<EmailPreview>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Set IMAP flags associated with a message. Only supports '\\Seen' flag. (asynchronously)
* Apply RFC3501 section-2.3.2 IMAP flag operations on an email
* @param emailId (required)
* @param imapFlagOperationOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call applyImapFlagOperationAsync(UUID emailId, ImapFlagOperationOptions imapFlagOperationOptions, final ApiCallback<EmailPreview> _callback) throws ApiException {
okhttp3.Call localVarCall = applyImapFlagOperationValidateBeforeCall(emailId, imapFlagOperationOptions, _callback);
Type localVarReturnType = new TypeToken<EmailPreview>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteAllEmails
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllEmailsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAllEmailsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return deleteAllEmailsCall(_callback);
}
/**
* Delete all emails in all inboxes.
* Deletes all emails in your account. Be careful as emails cannot be recovered
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAllEmails() throws ApiException {
deleteAllEmailsWithHttpInfo();
}
/**
* Delete all emails in all inboxes.
* Deletes all emails in your account. Be careful as emails cannot be recovered
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAllEmailsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = deleteAllEmailsValidateBeforeCall(null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all emails in all inboxes. (asynchronously)
* Deletes all emails in your account. Be careful as emails cannot be recovered
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllEmailsAsync(final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAllEmailsValidateBeforeCall(_callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteEmail
* @param emailId ID of email to delete (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteEmailCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteEmailValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling deleteEmail(Async)");
}
return deleteEmailCall(emailId, _callback);
}
/**
* Delete an email
* Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
* @param emailId ID of email to delete (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteEmail(UUID emailId) throws ApiException {
deleteEmailWithHttpInfo(emailId);
}
/**
* Delete an email
* Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
* @param emailId ID of email to delete (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteEmailWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = deleteEmailValidateBeforeCall(emailId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an email (asynchronously)
* Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
* @param emailId ID of email to delete (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteEmailAsync(UUID emailId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteEmailValidateBeforeCall(emailId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for downloadAttachment
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param apiKey Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentCall(UUID emailId, String attachmentId, String apiKey, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/attachments/{attachmentId}"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()))
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (apiKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("apiKey", apiKey));
}
final String[] localVarAccepts = {
"application/octet-stream"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call downloadAttachmentValidateBeforeCall(UUID emailId, String attachmentId, String apiKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling downloadAttachment(Async)");
}
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling downloadAttachment(Async)");
}
return downloadAttachmentCall(emailId, attachmentId, apiKey, _callback);
}
/**
* Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string.
* Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param apiKey Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional)
* @return byte[]
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public byte[] downloadAttachment(UUID emailId, String attachmentId, String apiKey) throws ApiException {
ApiResponse<byte[]> localVarResp = downloadAttachmentWithHttpInfo(emailId, attachmentId, apiKey);
return localVarResp.getData();
}
/**
* Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string.
* Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param apiKey Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional)
* @return ApiResponse<byte[]>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<byte[]> downloadAttachmentWithHttpInfo(UUID emailId, String attachmentId, String apiKey) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentValidateBeforeCall(emailId, attachmentId, apiKey, null);
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email attachment bytes. Returned as `octet-stream` with content type header. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints and convert the base 64 encoded content to a file or string. (asynchronously)
* Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param apiKey Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentAsync(UUID emailId, String attachmentId, String apiKey, final ApiCallback<byte[]> _callback) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentValidateBeforeCall(emailId, attachmentId, apiKey, _callback);
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for downloadAttachmentBase64
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentBase64Call(UUID emailId, String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/attachments/{attachmentId}/base64"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()))
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call downloadAttachmentBase64ValidateBeforeCall(UUID emailId, String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling downloadAttachmentBase64(Async)");
}
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling downloadAttachmentBase64(Async)");
}
return downloadAttachmentBase64Call(emailId, attachmentId, _callback);
}
/**
* Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`.
* Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @return DownloadAttachmentDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DownloadAttachmentDto downloadAttachmentBase64(UUID emailId, String attachmentId) throws ApiException {
ApiResponse<DownloadAttachmentDto> localVarResp = downloadAttachmentBase64WithHttpInfo(emailId, attachmentId);
return localVarResp.getData();
}
/**
* Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`.
* Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @return ApiResponse<DownloadAttachmentDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DownloadAttachmentDto> downloadAttachmentBase64WithHttpInfo(UUID emailId, String attachmentId) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentBase64ValidateBeforeCall(emailId, attachmentId, null);
Type localVarReturnType = new TypeToken<DownloadAttachmentDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`. (asynchronously)
* Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentBase64Async(UUID emailId, String attachmentId, final ApiCallback<DownloadAttachmentDto> _callback) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentBase64ValidateBeforeCall(emailId, attachmentId, _callback);
Type localVarReturnType = new TypeToken<DownloadAttachmentDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for downloadBody
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadBodyCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/body"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"text/plain",
"text/html"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call downloadBodyValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling downloadBody(Async)");
}
return downloadBodyCall(emailId, _callback);
}
/**
* Get email body as string. Returned as `plain/text` with content type header.
* Returns the specified email body for a given email as a string
* @param emailId ID of email (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String downloadBody(UUID emailId) throws ApiException {
ApiResponse<String> localVarResp = downloadBodyWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get email body as string. Returned as `plain/text` with content type header.
* Returns the specified email body for a given email as a string
* @param emailId ID of email (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> downloadBodyWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = downloadBodyValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email body as string. Returned as `plain/text` with content type header. (asynchronously)
* Returns the specified email body for a given email as a string
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadBodyAsync(UUID emailId, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = downloadBodyValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for downloadBodyBytes
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadBodyBytesCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/body-bytes"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/octet-stream"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call downloadBodyBytesValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling downloadBodyBytes(Async)");
}
return downloadBodyBytesCall(emailId, _callback);
}
/**
* Get email body in bytes. Returned as `octet-stream` with content type header.
* Returns the specified email body for a given email as a stream / array of bytes.
* @param emailId ID of email (required)
* @return byte[]
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public byte[] downloadBodyBytes(UUID emailId) throws ApiException {
ApiResponse<byte[]> localVarResp = downloadBodyBytesWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get email body in bytes. Returned as `octet-stream` with content type header.
* Returns the specified email body for a given email as a stream / array of bytes.
* @param emailId ID of email (required)
* @return ApiResponse<byte[]>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<byte[]> downloadBodyBytesWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = downloadBodyBytesValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email body in bytes. Returned as `octet-stream` with content type header. (asynchronously)
* Returns the specified email body for a given email as a stream / array of bytes.
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadBodyBytesAsync(UUID emailId, final ApiCallback<byte[]> _callback) throws ApiException {
okhttp3.Call localVarCall = downloadBodyBytesValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for forwardEmail
* @param emailId ID of email (required)
* @param forwardEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call forwardEmailCall(UUID emailId, ForwardEmailOptions forwardEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = forwardEmailOptions;
// create path and map variables
String localVarPath = "/emails/{emailId}/forward"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call forwardEmailValidateBeforeCall(UUID emailId, ForwardEmailOptions forwardEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling forwardEmail(Async)");
}
// verify the required parameter 'forwardEmailOptions' is set
if (forwardEmailOptions == null) {
throw new ApiException("Missing the required parameter 'forwardEmailOptions' when calling forwardEmail(Async)");
}
return forwardEmailCall(emailId, forwardEmailOptions, _callback);
}
/**
* Forward email to recipients
* Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the `from` option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints.
* @param emailId ID of email (required)
* @param forwardEmailOptions (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public SentEmailDto forwardEmail(UUID emailId, ForwardEmailOptions forwardEmailOptions) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = forwardEmailWithHttpInfo(emailId, forwardEmailOptions);
return localVarResp.getData();
}
/**
* Forward email to recipients
* Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the `from` option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints.
* @param emailId ID of email (required)
* @param forwardEmailOptions (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> forwardEmailWithHttpInfo(UUID emailId, ForwardEmailOptions forwardEmailOptions) throws ApiException {
okhttp3.Call localVarCall = forwardEmailValidateBeforeCall(emailId, forwardEmailOptions, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Forward email to recipients (asynchronously)
* Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the `from` option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints.
* @param emailId ID of email (required)
* @param forwardEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call forwardEmailAsync(UUID emailId, ForwardEmailOptions forwardEmailOptions, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = forwardEmailValidateBeforeCall(emailId, forwardEmailOptions, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAttachmentMetaData
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentMetaDataCall(UUID emailId, String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/attachments/{attachmentId}/metadata"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()))
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAttachmentMetaDataValidateBeforeCall(UUID emailId, String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getAttachmentMetaData(Async)");
}
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling getAttachmentMetaData(Async)");
}
return getAttachmentMetaDataCall(emailId, attachmentId, _callback);
}
/**
* Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods.
* Returns the metadata such as name and content-type for a given attachment and email.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @return AttachmentMetaData
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public AttachmentMetaData getAttachmentMetaData(UUID emailId, String attachmentId) throws ApiException {
ApiResponse<AttachmentMetaData> localVarResp = getAttachmentMetaDataWithHttpInfo(emailId, attachmentId);
return localVarResp.getData();
}
/**
* Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods.
* Returns the metadata such as name and content-type for a given attachment and email.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @return ApiResponse<AttachmentMetaData>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<AttachmentMetaData> getAttachmentMetaDataWithHttpInfo(UUID emailId, String attachmentId) throws ApiException {
okhttp3.Call localVarCall = getAttachmentMetaDataValidateBeforeCall(emailId, attachmentId, null);
Type localVarReturnType = new TypeToken<AttachmentMetaData>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments use the `downloadAttachment` methods. (asynchronously)
* Returns the metadata such as name and content-type for a given attachment and email.
* @param emailId ID of email (required)
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentMetaDataAsync(UUID emailId, String attachmentId, final ApiCallback<AttachmentMetaData> _callback) throws ApiException {
okhttp3.Call localVarCall = getAttachmentMetaDataValidateBeforeCall(emailId, attachmentId, _callback);
Type localVarReturnType = new TypeToken<AttachmentMetaData>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmail
* @param emailId (required)
* @param decode Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional, default to false)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailCall(UUID emailId, Boolean decode, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (decode != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("decode", decode));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailValidateBeforeCall(UUID emailId, Boolean decode, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmail(Async)");
}
return getEmailCall(emailId, decode, _callback);
}
/**
* Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.
* Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints
* @param emailId (required)
* @param decode Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional, default to false)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email getEmail(UUID emailId, Boolean decode) throws ApiException {
ApiResponse<Email> localVarResp = getEmailWithHttpInfo(emailId, decode);
return localVarResp.getData();
}
/**
* Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.
* Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints
* @param emailId (required)
* @param decode Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional, default to false)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> getEmailWithHttpInfo(UUID emailId, Boolean decode) throws ApiException {
okhttp3.Call localVarCall = getEmailValidateBeforeCall(emailId, decode, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController. (asynchronously)
* Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints
* @param emailId (required)
* @param decode Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing (optional, default to false)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailAsync(UUID emailId, Boolean decode, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailValidateBeforeCall(emailId, decode, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailAttachments
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailAttachmentsCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/attachments"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailAttachmentsValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailAttachments(Async)");
}
return getEmailAttachmentsCall(emailId, _callback);
}
/**
* Get all email attachment metadata. Metadata includes name and size of attachments.
* Returns an array of attachment metadata such as name and content-type for a given email if present.
* @param emailId ID of email (required)
* @return List<AttachmentMetaData>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<AttachmentMetaData> getEmailAttachments(UUID emailId) throws ApiException {
ApiResponse<List<AttachmentMetaData>> localVarResp = getEmailAttachmentsWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get all email attachment metadata. Metadata includes name and size of attachments.
* Returns an array of attachment metadata such as name and content-type for a given email if present.
* @param emailId ID of email (required)
* @return ApiResponse<List<AttachmentMetaData>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<AttachmentMetaData>> getEmailAttachmentsWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getEmailAttachmentsValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<List<AttachmentMetaData>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all email attachment metadata. Metadata includes name and size of attachments. (asynchronously)
* Returns an array of attachment metadata such as name and content-type for a given email if present.
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailAttachmentsAsync(UUID emailId, final ApiCallback<List<AttachmentMetaData>> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailAttachmentsValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<List<AttachmentMetaData>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailContentMatch
* @param emailId ID of email to match against (required)
* @param contentMatchOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailContentMatchCall(UUID emailId, ContentMatchOptions contentMatchOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = contentMatchOptions;
// create path and map variables
String localVarPath = "/emails/{emailId}/contentMatch"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailContentMatchValidateBeforeCall(UUID emailId, ContentMatchOptions contentMatchOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailContentMatch(Async)");
}
// verify the required parameter 'contentMatchOptions' is set
if (contentMatchOptions == null) {
throw new ApiException("Missing the required parameter 'contentMatchOptions' when calling getEmailContentMatch(Async)");
}
return getEmailContentMatchCall(emailId, contentMatchOptions, _callback);
}
/**
* Get email content regex pattern match results. Runs regex against email body and returns match groups.
* Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
* @param emailId ID of email to match against (required)
* @param contentMatchOptions (required)
* @return EmailContentMatchResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailContentMatchResult getEmailContentMatch(UUID emailId, ContentMatchOptions contentMatchOptions) throws ApiException {
ApiResponse<EmailContentMatchResult> localVarResp = getEmailContentMatchWithHttpInfo(emailId, contentMatchOptions);
return localVarResp.getData();
}
/**
* Get email content regex pattern match results. Runs regex against email body and returns match groups.
* Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
* @param emailId ID of email to match against (required)
* @param contentMatchOptions (required)
* @return ApiResponse<EmailContentMatchResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailContentMatchResult> getEmailContentMatchWithHttpInfo(UUID emailId, ContentMatchOptions contentMatchOptions) throws ApiException {
okhttp3.Call localVarCall = getEmailContentMatchValidateBeforeCall(emailId, contentMatchOptions, null);
Type localVarReturnType = new TypeToken<EmailContentMatchResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email content regex pattern match results. Runs regex against email body and returns match groups. (asynchronously)
* Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
* @param emailId ID of email to match against (required)
* @param contentMatchOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailContentMatchAsync(UUID emailId, ContentMatchOptions contentMatchOptions, final ApiCallback<EmailContentMatchResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailContentMatchValidateBeforeCall(emailId, contentMatchOptions, _callback);
Type localVarReturnType = new TypeToken<EmailContentMatchResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailCount
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailCountCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/emails/count";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailCountValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getEmailCountCall(_callback);
}
/**
* Get email count
*
* @return CountDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public CountDto getEmailCount() throws ApiException {
ApiResponse<CountDto> localVarResp = getEmailCountWithHttpInfo();
return localVarResp.getData();
}
/**
* Get email count
*
* @return ApiResponse<CountDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<CountDto> getEmailCountWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getEmailCountValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<CountDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email count (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailCountAsync(final ApiCallback<CountDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailCountValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<CountDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailHTML
* @param emailId (required)
* @param decode (optional, default to false)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailHTMLCall(UUID emailId, Boolean decode, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/html"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (decode != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("decode", decode));
}
final String[] localVarAccepts = {
"text/html;charset=utf-8",
"text/html"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailHTMLValidateBeforeCall(UUID emailId, Boolean decode, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailHTML(Async)");
}
return getEmailHTMLCall(emailId, decode, _callback);
}
/**
* Get email content as HTML. For displaying emails in browser context.
* Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`. Returns content-type `text/html;charset=utf-8` so you must call expecting that content response not JSON. For JSON response see the `getEmailHTMLJson` method.
* @param emailId (required)
* @param decode (optional, default to false)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String getEmailHTML(UUID emailId, Boolean decode) throws ApiException {
ApiResponse<String> localVarResp = getEmailHTMLWithHttpInfo(emailId, decode);
return localVarResp.getData();
}
/**
* Get email content as HTML. For displaying emails in browser context.
* Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`. Returns content-type `text/html;charset=utf-8` so you must call expecting that content response not JSON. For JSON response see the `getEmailHTMLJson` method.
* @param emailId (required)
* @param decode (optional, default to false)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> getEmailHTMLWithHttpInfo(UUID emailId, Boolean decode) throws ApiException {
okhttp3.Call localVarCall = getEmailHTMLValidateBeforeCall(emailId, decode, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email content as HTML. For displaying emails in browser context. (asynchronously)
* Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: `?apiKey=xxx`. Returns content-type `text/html;charset=utf-8` so you must call expecting that content response not JSON. For JSON response see the `getEmailHTMLJson` method.
* @param emailId (required)
* @param decode (optional, default to false)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailHTMLAsync(UUID emailId, Boolean decode, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailHTMLValidateBeforeCall(emailId, decode, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailHTMLJson
* @param emailId (required)
* @param decode (optional, default to false)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailHTMLJsonCall(UUID emailId, Boolean decode, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/html/json"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (decode != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("decode", decode));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailHTMLJsonValidateBeforeCall(UUID emailId, Boolean decode, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailHTMLJson(Async)");
}
return getEmailHTMLJsonCall(emailId, decode, _callback);
}
/**
* Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content
* Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type `application/json;charset=utf-8` so you must call expecting that content response not JSON.
* @param emailId (required)
* @param decode (optional, default to false)
* @return EmailHtmlDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailHtmlDto getEmailHTMLJson(UUID emailId, Boolean decode) throws ApiException {
ApiResponse<EmailHtmlDto> localVarResp = getEmailHTMLJsonWithHttpInfo(emailId, decode);
return localVarResp.getData();
}
/**
* Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content
* Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type `application/json;charset=utf-8` so you must call expecting that content response not JSON.
* @param emailId (required)
* @param decode (optional, default to false)
* @return ApiResponse<EmailHtmlDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailHtmlDto> getEmailHTMLJsonWithHttpInfo(UUID emailId, Boolean decode) throws ApiException {
okhttp3.Call localVarCall = getEmailHTMLJsonValidateBeforeCall(emailId, decode, null);
Type localVarReturnType = new TypeToken<EmailHtmlDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content (asynchronously)
* Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type `application/json;charset=utf-8` so you must call expecting that content response not JSON.
* @param emailId (required)
* @param decode (optional, default to false)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailHTMLJsonAsync(UUID emailId, Boolean decode, final ApiCallback<EmailHtmlDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailHTMLJsonValidateBeforeCall(emailId, decode, _callback);
Type localVarReturnType = new TypeToken<EmailHtmlDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailHTMLQuery
* @param emailId ID of email to perform HTML query on (required)
* @param htmlSelector HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailHTMLQueryCall(UUID emailId, String htmlSelector, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/htmlQuery"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (htmlSelector != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("htmlSelector", htmlSelector));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailHTMLQueryValidateBeforeCall(UUID emailId, String htmlSelector, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailHTMLQuery(Async)");
}
// verify the required parameter 'htmlSelector' is set
if (htmlSelector == null) {
throw new ApiException("Missing the required parameter 'htmlSelector' when calling getEmailHTMLQuery(Async)");
}
return getEmailHTMLQueryCall(emailId, htmlSelector, _callback);
}
/**
* Parse and return text from an email, stripping HTML and decoding encoded characters
* Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors
* @param emailId ID of email to perform HTML query on (required)
* @param htmlSelector HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. (required)
* @return EmailTextLinesResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailTextLinesResult getEmailHTMLQuery(UUID emailId, String htmlSelector) throws ApiException {
ApiResponse<EmailTextLinesResult> localVarResp = getEmailHTMLQueryWithHttpInfo(emailId, htmlSelector);
return localVarResp.getData();
}
/**
* Parse and return text from an email, stripping HTML and decoding encoded characters
* Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors
* @param emailId ID of email to perform HTML query on (required)
* @param htmlSelector HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. (required)
* @return ApiResponse<EmailTextLinesResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailTextLinesResult> getEmailHTMLQueryWithHttpInfo(UUID emailId, String htmlSelector) throws ApiException {
okhttp3.Call localVarCall = getEmailHTMLQueryValidateBeforeCall(emailId, htmlSelector, null);
Type localVarReturnType = new TypeToken<EmailTextLinesResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Parse and return text from an email, stripping HTML and decoding encoded characters (asynchronously)
* Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors
* @param emailId ID of email to perform HTML query on (required)
* @param htmlSelector HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailHTMLQueryAsync(UUID emailId, String htmlSelector, final ApiCallback<EmailTextLinesResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailHTMLQueryValidateBeforeCall(emailId, htmlSelector, _callback);
Type localVarReturnType = new TypeToken<EmailTextLinesResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailLinks
* @param emailId ID of email to fetch text for (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailLinksCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/links"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailLinksValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailLinks(Async)");
}
return getEmailLinksCall(emailId, _callback);
}
/**
* Parse and return list of links found in an email (only works for HTML content)
* HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes
* @param emailId ID of email to fetch text for (required)
* @return EmailLinksResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailLinksResult getEmailLinks(UUID emailId) throws ApiException {
ApiResponse<EmailLinksResult> localVarResp = getEmailLinksWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Parse and return list of links found in an email (only works for HTML content)
* HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes
* @param emailId ID of email to fetch text for (required)
* @return ApiResponse<EmailLinksResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailLinksResult> getEmailLinksWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getEmailLinksValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<EmailLinksResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Parse and return list of links found in an email (only works for HTML content) (asynchronously)
* HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes
* @param emailId ID of email to fetch text for (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailLinksAsync(UUID emailId, final ApiCallback<EmailLinksResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailLinksValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<EmailLinksResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailPreviewURLs
* @param emailId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailPreviewURLsCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/urls"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailPreviewURLsValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailPreviewURLs(Async)");
}
return getEmailPreviewURLsCall(emailId, _callback);
}
/**
* Get email URLs for viewing in browser or downloading
* Get a list of URLs for email content as text/html or raw SMTP message for viewing the message in a browser.
* @param emailId (required)
* @return EmailPreviewUrls
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailPreviewUrls getEmailPreviewURLs(UUID emailId) throws ApiException {
ApiResponse<EmailPreviewUrls> localVarResp = getEmailPreviewURLsWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get email URLs for viewing in browser or downloading
* Get a list of URLs for email content as text/html or raw SMTP message for viewing the message in a browser.
* @param emailId (required)
* @return ApiResponse<EmailPreviewUrls>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailPreviewUrls> getEmailPreviewURLsWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getEmailPreviewURLsValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<EmailPreviewUrls>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email URLs for viewing in browser or downloading (asynchronously)
* Get a list of URLs for email content as text/html or raw SMTP message for viewing the message in a browser.
* @param emailId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailPreviewURLsAsync(UUID emailId, final ApiCallback<EmailPreviewUrls> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailPreviewURLsValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<EmailPreviewUrls>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailTextLines
* @param emailId ID of email to fetch text for (required)
* @param decodeHtmlEntities Decode HTML entities (optional)
* @param lineSeparator Line separator character (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailTextLinesCall(UUID emailId, Boolean decodeHtmlEntities, String lineSeparator, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/textLines"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (decodeHtmlEntities != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("decodeHtmlEntities", decodeHtmlEntities));
}
if (lineSeparator != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("lineSeparator", lineSeparator));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailTextLinesValidateBeforeCall(UUID emailId, Boolean decodeHtmlEntities, String lineSeparator, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getEmailTextLines(Async)");
}
return getEmailTextLinesCall(emailId, decodeHtmlEntities, lineSeparator, _callback);
}
/**
* Parse and return text from an email, stripping HTML and decoding encoded characters
* Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
* @param emailId ID of email to fetch text for (required)
* @param decodeHtmlEntities Decode HTML entities (optional)
* @param lineSeparator Line separator character (optional)
* @return EmailTextLinesResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailTextLinesResult getEmailTextLines(UUID emailId, Boolean decodeHtmlEntities, String lineSeparator) throws ApiException {
ApiResponse<EmailTextLinesResult> localVarResp = getEmailTextLinesWithHttpInfo(emailId, decodeHtmlEntities, lineSeparator);
return localVarResp.getData();
}
/**
* Parse and return text from an email, stripping HTML and decoding encoded characters
* Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
* @param emailId ID of email to fetch text for (required)
* @param decodeHtmlEntities Decode HTML entities (optional)
* @param lineSeparator Line separator character (optional)
* @return ApiResponse<EmailTextLinesResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailTextLinesResult> getEmailTextLinesWithHttpInfo(UUID emailId, Boolean decodeHtmlEntities, String lineSeparator) throws ApiException {
okhttp3.Call localVarCall = getEmailTextLinesValidateBeforeCall(emailId, decodeHtmlEntities, lineSeparator, null);
Type localVarReturnType = new TypeToken<EmailTextLinesResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Parse and return text from an email, stripping HTML and decoding encoded characters (asynchronously)
* Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
* @param emailId ID of email to fetch text for (required)
* @param decodeHtmlEntities Decode HTML entities (optional)
* @param lineSeparator Line separator character (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailTextLinesAsync(UUID emailId, Boolean decodeHtmlEntities, String lineSeparator, final ApiCallback<EmailTextLinesResult> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailTextLinesValidateBeforeCall(emailId, decodeHtmlEntities, lineSeparator, _callback);
Type localVarReturnType = new TypeToken<EmailTextLinesResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getEmailsPaginated
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailsPaginatedCall(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEmailsPaginatedValidateBeforeCall(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getEmailsPaginatedCall(inboxId, page, size, sort, unreadOnly, searchFilter, since, before, _callback);
}
/**
* Get all emails in all inboxes in paginated form. Email API list all.
* By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @return PageEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageEmailProjection getEmailsPaginated(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageEmailProjection> localVarResp = getEmailsPaginatedWithHttpInfo(inboxId, page, size, sort, unreadOnly, searchFilter, since, before);
return localVarResp.getData();
}
/**
* Get all emails in all inboxes in paginated form. Email API list all.
* By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @return ApiResponse<PageEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageEmailProjection> getEmailsPaginatedWithHttpInfo(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getEmailsPaginatedValidateBeforeCall(inboxId, page, size, sort, unreadOnly, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all emails in all inboxes in paginated form. Email API list all. (asynchronously)
* By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEmailsPaginatedAsync(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getEmailsPaginatedValidateBeforeCall(inboxId, page, size, sort, unreadOnly, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getGravatarUrlForEmailAddress
* @param emailAddress (required)
* @param size (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGravatarUrlForEmailAddressCall(String emailAddress, String size, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/gravatarFor";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailAddress", emailAddress));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getGravatarUrlForEmailAddressValidateBeforeCall(String emailAddress, String size, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailAddress' is set
if (emailAddress == null) {
throw new ApiException("Missing the required parameter 'emailAddress' when calling getGravatarUrlForEmailAddress(Async)");
}
return getGravatarUrlForEmailAddressCall(emailAddress, size, _callback);
}
/**
*
* Get gravatar url for email address
* @param emailAddress (required)
* @param size (optional)
* @return GravatarUrl
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public GravatarUrl getGravatarUrlForEmailAddress(String emailAddress, String size) throws ApiException {
ApiResponse<GravatarUrl> localVarResp = getGravatarUrlForEmailAddressWithHttpInfo(emailAddress, size);
return localVarResp.getData();
}
/**
*
* Get gravatar url for email address
* @param emailAddress (required)
* @param size (optional)
* @return ApiResponse<GravatarUrl>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<GravatarUrl> getGravatarUrlForEmailAddressWithHttpInfo(String emailAddress, String size) throws ApiException {
okhttp3.Call localVarCall = getGravatarUrlForEmailAddressValidateBeforeCall(emailAddress, size, null);
Type localVarReturnType = new TypeToken<GravatarUrl>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Get gravatar url for email address
* @param emailAddress (required)
* @param size (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getGravatarUrlForEmailAddressAsync(String emailAddress, String size, final ApiCallback<GravatarUrl> _callback) throws ApiException {
okhttp3.Call localVarCall = getGravatarUrlForEmailAddressValidateBeforeCall(emailAddress, size, _callback);
Type localVarReturnType = new TypeToken<GravatarUrl>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getLatestEmail
* @param inboxIds Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getLatestEmailCall(List<UUID> inboxIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/latest";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxIds != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "inboxIds", inboxIds));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getLatestEmailValidateBeforeCall(List<UUID> inboxIds, final ApiCallback _callback) throws ApiException {
return getLatestEmailCall(inboxIds, _callback);
}
/**
* Get latest email in all inboxes. Most recently received.
* Get the newest email in all inboxes or in a passed set of inbox IDs
* @param inboxIds Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email getLatestEmail(List<UUID> inboxIds) throws ApiException {
ApiResponse<Email> localVarResp = getLatestEmailWithHttpInfo(inboxIds);
return localVarResp.getData();
}
/**
* Get latest email in all inboxes. Most recently received.
* Get the newest email in all inboxes or in a passed set of inbox IDs
* @param inboxIds Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> getLatestEmailWithHttpInfo(List<UUID> inboxIds) throws ApiException {
okhttp3.Call localVarCall = getLatestEmailValidateBeforeCall(inboxIds, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get latest email in all inboxes. Most recently received. (asynchronously)
* Get the newest email in all inboxes or in a passed set of inbox IDs
* @param inboxIds Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getLatestEmailAsync(List<UUID> inboxIds, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = getLatestEmailValidateBeforeCall(inboxIds, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getLatestEmailInInbox1
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getLatestEmailInInbox1Call(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/latestIn";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getLatestEmailInInbox1ValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling getLatestEmailInInbox1(Async)");
}
return getLatestEmailInInbox1Call(inboxId, _callback);
}
/**
* Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet.
* Get the newest email in all inboxes or in a passed set of inbox IDs
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @return Email
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public Email getLatestEmailInInbox1(UUID inboxId) throws ApiException {
ApiResponse<Email> localVarResp = getLatestEmailInInbox1WithHttpInfo(inboxId);
return localVarResp.getData();
}
/**
* Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet.
* Get the newest email in all inboxes or in a passed set of inbox IDs
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @return ApiResponse<Email>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<Email> getLatestEmailInInbox1WithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = getLatestEmailInInbox1ValidateBeforeCall(inboxId, null);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. (asynchronously)
* Get the newest email in all inboxes or in a passed set of inbox IDs
* @param inboxId ID of the inbox you want to get the latest email from (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getLatestEmailInInbox1Async(UUID inboxId, final ApiCallback<Email> _callback) throws ApiException {
okhttp3.Call localVarCall = getLatestEmailInInbox1ValidateBeforeCall(inboxId, _callback);
Type localVarReturnType = new TypeToken<Email>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getOrganizationEmailsPaginated
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter search filter for emails. (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getOrganizationEmailsPaginatedCall(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/organization";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "inboxId", inboxId));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (unreadOnly != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("unreadOnly", unreadOnly));
}
if (searchFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("searchFilter", searchFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getOrganizationEmailsPaginatedValidateBeforeCall(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getOrganizationEmailsPaginatedCall(inboxId, page, size, sort, unreadOnly, searchFilter, since, before, _callback);
}
/**
* Get all organization emails. List team or shared test email accounts
* By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter search filter for emails. (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @return PageEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageEmailProjection getOrganizationEmailsPaginated(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageEmailProjection> localVarResp = getOrganizationEmailsPaginatedWithHttpInfo(inboxId, page, size, sort, unreadOnly, searchFilter, since, before);
return localVarResp.getData();
}
/**
* Get all organization emails. List team or shared test email accounts
* By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter search filter for emails. (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @return ApiResponse<PageEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageEmailProjection> getOrganizationEmailsPaginatedWithHttpInfo(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getOrganizationEmailsPaginatedValidateBeforeCall(inboxId, page, size, sort, unreadOnly, searchFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all organization emails. List team or shared test email accounts (asynchronously)
* By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
* @param inboxId Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
* @param page Optional page index in email list pagination (optional, default to 0)
* @param size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param unreadOnly Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional, default to false)
* @param searchFilter Optional search filter search filter for emails. (optional)
* @param since Optional filter emails received after given date time (optional)
* @param before Optional filter emails received before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getOrganizationEmailsPaginatedAsync(List<UUID> inboxId, Integer page, Integer size, String sort, Boolean unreadOnly, String searchFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getOrganizationEmailsPaginatedValidateBeforeCall(inboxId, page, size, sort, unreadOnly, searchFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getRawEmailContents
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawEmailContentsCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/raw"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getRawEmailContentsValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getRawEmailContents(Async)");
}
return getRawEmailContentsCall(emailId, _callback);
}
/**
* Get raw email string. Returns unparsed raw SMTP message with headers and body.
* Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
* @param emailId ID of email (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public String getRawEmailContents(UUID emailId) throws ApiException {
ApiResponse<String> localVarResp = getRawEmailContentsWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get raw email string. Returns unparsed raw SMTP message with headers and body.
* Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
* @param emailId ID of email (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<String> getRawEmailContentsWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getRawEmailContentsValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<String>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get raw email string. Returns unparsed raw SMTP message with headers and body. (asynchronously)
* Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawEmailContentsAsync(UUID emailId, final ApiCallback<String> _callback) throws ApiException {
okhttp3.Call localVarCall = getRawEmailContentsValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<String>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getRawEmailJson
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawEmailJsonCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/raw/json"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getRawEmailJsonValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling getRawEmailJson(Async)");
}
return getRawEmailJsonCall(emailId, _callback);
}
/**
* Get raw email in JSON. Unparsed SMTP message in JSON wrapper format.
* Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
* @param emailId ID of email (required)
* @return RawEmailJson
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public RawEmailJson getRawEmailJson(UUID emailId) throws ApiException {
ApiResponse<RawEmailJson> localVarResp = getRawEmailJsonWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Get raw email in JSON. Unparsed SMTP message in JSON wrapper format.
* Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
* @param emailId ID of email (required)
* @return ApiResponse<RawEmailJson>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<RawEmailJson> getRawEmailJsonWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = getRawEmailJsonValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<RawEmailJson>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get raw email in JSON. Unparsed SMTP message in JSON wrapper format. (asynchronously)
* Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getRawEmailJsonAsync(UUID emailId, final ApiCallback<RawEmailJson> _callback) throws ApiException {
okhttp3.Call localVarCall = getRawEmailJsonValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<RawEmailJson>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getUnreadEmailCount
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getUnreadEmailCountCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/unreadCount";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getUnreadEmailCountValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getUnreadEmailCountCall(_callback);
}
/**
* Get unread email count
* Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response
* @return UnreadCount
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public UnreadCount getUnreadEmailCount() throws ApiException {
ApiResponse<UnreadCount> localVarResp = getUnreadEmailCountWithHttpInfo();
return localVarResp.getData();
}
/**
* Get unread email count
* Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response
* @return ApiResponse<UnreadCount>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<UnreadCount> getUnreadEmailCountWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getUnreadEmailCountValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<UnreadCount>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get unread email count (asynchronously)
* Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getUnreadEmailCountAsync(final ApiCallback<UnreadCount> _callback) throws ApiException {
okhttp3.Call localVarCall = getUnreadEmailCountValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<UnreadCount>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for markAsRead
* @param emailId (required)
* @param read What value to assign to email read property. Default true. (optional, default to true)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call markAsReadCall(UUID emailId, Boolean read, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/read"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (read != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("read", read));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call markAsReadValidateBeforeCall(UUID emailId, Boolean read, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling markAsRead(Async)");
}
return markAsReadCall(emailId, read, _callback);
}
/**
* Mark an email as read on unread
* Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread
* @param emailId (required)
* @param read What value to assign to email read property. Default true. (optional, default to true)
* @return EmailPreview
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public EmailPreview markAsRead(UUID emailId, Boolean read) throws ApiException {
ApiResponse<EmailPreview> localVarResp = markAsReadWithHttpInfo(emailId, read);
return localVarResp.getData();
}
/**
* Mark an email as read on unread
* Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread
* @param emailId (required)
* @param read What value to assign to email read property. Default true. (optional, default to true)
* @return ApiResponse<EmailPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<EmailPreview> markAsReadWithHttpInfo(UUID emailId, Boolean read) throws ApiException {
okhttp3.Call localVarCall = markAsReadValidateBeforeCall(emailId, read, null);
Type localVarReturnType = new TypeToken<EmailPreview>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Mark an email as read on unread (asynchronously)
* Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread
* @param emailId (required)
* @param read What value to assign to email read property. Default true. (optional, default to true)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call markAsReadAsync(UUID emailId, Boolean read, final ApiCallback<EmailPreview> _callback) throws ApiException {
okhttp3.Call localVarCall = markAsReadValidateBeforeCall(emailId, read, _callback);
Type localVarReturnType = new TypeToken<EmailPreview>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for replyToEmail
* @param emailId ID of the email that should be replied to (required)
* @param replyToEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call replyToEmailCall(UUID emailId, ReplyToEmailOptions replyToEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = replyToEmailOptions;
// create path and map variables
String localVarPath = "/emails/{emailId}"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call replyToEmailValidateBeforeCall(UUID emailId, ReplyToEmailOptions replyToEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling replyToEmail(Async)");
}
// verify the required parameter 'replyToEmailOptions' is set
if (replyToEmailOptions == null) {
throw new ApiException("Missing the required parameter 'replyToEmailOptions' when calling replyToEmail(Async)");
}
return replyToEmailCall(emailId, replyToEmailOptions, _callback);
}
/**
* Reply to an email
* Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
* @param emailId ID of the email that should be replied to (required)
* @param replyToEmailOptions (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SentEmailDto replyToEmail(UUID emailId, ReplyToEmailOptions replyToEmailOptions) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = replyToEmailWithHttpInfo(emailId, replyToEmailOptions);
return localVarResp.getData();
}
/**
* Reply to an email
* Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
* @param emailId ID of the email that should be replied to (required)
* @param replyToEmailOptions (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> replyToEmailWithHttpInfo(UUID emailId, ReplyToEmailOptions replyToEmailOptions) throws ApiException {
okhttp3.Call localVarCall = replyToEmailValidateBeforeCall(emailId, replyToEmailOptions, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Reply to an email (asynchronously)
* Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
* @param emailId ID of the email that should be replied to (required)
* @param replyToEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call replyToEmailAsync(UUID emailId, ReplyToEmailOptions replyToEmailOptions, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = replyToEmailValidateBeforeCall(emailId, replyToEmailOptions, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for sendEmailSourceOptional
* @param sendEmailOptions (required)
* @param inboxId ID of the inbox you want to send the email from (optional)
* @param useDomainPool Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional)
* @param virtualSend Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailSourceOptionalCall(SendEmailOptions sendEmailOptions, UUID inboxId, Boolean useDomainPool, Boolean virtualSend, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendEmailOptions;
// create path and map variables
String localVarPath = "/emails";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
if (useDomainPool != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useDomainPool", useDomainPool));
}
if (virtualSend != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("virtualSend", virtualSend));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendEmailSourceOptionalValidateBeforeCall(SendEmailOptions sendEmailOptions, UUID inboxId, Boolean useDomainPool, Boolean virtualSend, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sendEmailOptions' is set
if (sendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'sendEmailOptions' when calling sendEmailSourceOptional(Async)");
}
return sendEmailSourceOptionalCall(sendEmailOptions, inboxId, useDomainPool, virtualSend, _callback);
}
/**
* Send email
* Alias for `InboxController.sendEmail` method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email.
* @param sendEmailOptions (required)
* @param inboxId ID of the inbox you want to send the email from (optional)
* @param useDomainPool Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional)
* @param virtualSend Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public void sendEmailSourceOptional(SendEmailOptions sendEmailOptions, UUID inboxId, Boolean useDomainPool, Boolean virtualSend) throws ApiException {
sendEmailSourceOptionalWithHttpInfo(sendEmailOptions, inboxId, useDomainPool, virtualSend);
}
/**
* Send email
* Alias for `InboxController.sendEmail` method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email.
* @param sendEmailOptions (required)
* @param inboxId ID of the inbox you want to send the email from (optional)
* @param useDomainPool Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional)
* @param virtualSend Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> sendEmailSourceOptionalWithHttpInfo(SendEmailOptions sendEmailOptions, UUID inboxId, Boolean useDomainPool, Boolean virtualSend) throws ApiException {
okhttp3.Call localVarCall = sendEmailSourceOptionalValidateBeforeCall(sendEmailOptions, inboxId, useDomainPool, virtualSend, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Send email (asynchronously)
* Alias for `InboxController.sendEmail` method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email.
* @param sendEmailOptions (required)
* @param inboxId ID of the inbox you want to send the email from (optional)
* @param useDomainPool Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional)
* @param virtualSend Optionally create inbox to send from that is a virtual inbox and won't send to external addresses (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailSourceOptionalAsync(SendEmailOptions sendEmailOptions, UUID inboxId, Boolean useDomainPool, Boolean virtualSend, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = sendEmailSourceOptionalValidateBeforeCall(sendEmailOptions, inboxId, useDomainPool, virtualSend, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for validateEmail
* @param emailId ID of email (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call validateEmailCall(UUID emailId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emails/{emailId}/validate"
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call validateEmailValidateBeforeCall(UUID emailId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling validateEmail(Async)");
}
return validateEmailCall(emailId, _callback);
}
/**
* Validate email HTML contents
* Validate the HTML content of email if HTML is found. Considered valid if no HTML is present.
* @param emailId ID of email (required)
* @return ValidationDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ValidationDto validateEmail(UUID emailId) throws ApiException {
ApiResponse<ValidationDto> localVarResp = validateEmailWithHttpInfo(emailId);
return localVarResp.getData();
}
/**
* Validate email HTML contents
* Validate the HTML content of email if HTML is found. Considered valid if no HTML is present.
* @param emailId ID of email (required)
* @return ApiResponse<ValidationDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<ValidationDto> validateEmailWithHttpInfo(UUID emailId) throws ApiException {
okhttp3.Call localVarCall = validateEmailValidateBeforeCall(emailId, null);
Type localVarReturnType = new TypeToken<ValidationDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Validate email HTML contents (asynchronously)
* Validate the HTML content of email if HTML is found. Considered valid if no HTML is present.
* @param emailId ID of email (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call validateEmailAsync(UUID emailId, final ApiCallback<ValidationDto> _callback) throws ApiException {
okhttp3.Call localVarCall = validateEmailValidateBeforeCall(emailId, _callback);
Type localVarReturnType = new TypeToken<ValidationDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateDomainOptions;
import com.mailslurp.models.DomainDto;
import com.mailslurp.models.DomainIssuesDto;
import com.mailslurp.models.DomainPreview;
import com.mailslurp.models.InboxDto;
import java.util.UUID;
import com.mailslurp.models.UpdateDomainOptions;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class DomainControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public DomainControllerApi() {
this(Configuration.getDefaultApiClient());
}
public DomainControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for addDomainWildcardCatchAll
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call addDomainWildcardCatchAllCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/domains/{id}/wildcard"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addDomainWildcardCatchAllValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling addDomainWildcardCatchAll(Async)");
}
return addDomainWildcardCatchAllCall(id, _callback);
}
/**
* Add catch all wild card inbox to domain
* Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated
* @param id (required)
* @return DomainDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DomainDto addDomainWildcardCatchAll(UUID id) throws ApiException {
ApiResponse<DomainDto> localVarResp = addDomainWildcardCatchAllWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Add catch all wild card inbox to domain
* Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated
* @param id (required)
* @return ApiResponse<DomainDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DomainDto> addDomainWildcardCatchAllWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = addDomainWildcardCatchAllValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Add catch all wild card inbox to domain (asynchronously)
* Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call addDomainWildcardCatchAllAsync(UUID id, final ApiCallback<DomainDto> _callback) throws ApiException {
okhttp3.Call localVarCall = addDomainWildcardCatchAllValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createDomain
* @param createDomainOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createDomainCall(CreateDomainOptions createDomainOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createDomainOptions;
// create path and map variables
String localVarPath = "/domains";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createDomainValidateBeforeCall(CreateDomainOptions createDomainOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createDomainOptions' is set
if (createDomainOptions == null) {
throw new ApiException("Missing the required parameter 'createDomainOptions' when calling createDomain(Async)");
}
return createDomainCall(createDomainOptions, _callback);
}
/**
* Create Domain
* Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.
* @param createDomainOptions (required)
* @return DomainDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public DomainDto createDomain(CreateDomainOptions createDomainOptions) throws ApiException {
ApiResponse<DomainDto> localVarResp = createDomainWithHttpInfo(createDomainOptions);
return localVarResp.getData();
}
/**
* Create Domain
* Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.
* @param createDomainOptions (required)
* @return ApiResponse<DomainDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<DomainDto> createDomainWithHttpInfo(CreateDomainOptions createDomainOptions) throws ApiException {
okhttp3.Call localVarCall = createDomainValidateBeforeCall(createDomainOptions, null);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create Domain (asynchronously)
* Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.
* @param createDomainOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createDomainAsync(CreateDomainOptions createDomainOptions, final ApiCallback<DomainDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createDomainValidateBeforeCall(createDomainOptions, _callback);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteDomain
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteDomainCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/domains/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteDomainValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteDomain(Async)");
}
return deleteDomainCall(id, _callback);
}
/**
* Delete a domain
* Delete a domain. This will disable any existing inboxes that use this domain.
* @param id (required)
* @return List<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public List<String> deleteDomain(UUID id) throws ApiException {
ApiResponse<List<String>> localVarResp = deleteDomainWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Delete a domain
* Delete a domain. This will disable any existing inboxes that use this domain.
* @param id (required)
* @return ApiResponse<List<String>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<String>> deleteDomainWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = deleteDomainValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Delete a domain (asynchronously)
* Delete a domain. This will disable any existing inboxes that use this domain.
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteDomainAsync(UUID id, final ApiCallback<List<String>> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteDomainValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getDomain
* @param id (required)
* @param checkForErrors (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainCall(UUID id, Boolean checkForErrors, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/domains/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (checkForErrors != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("checkForErrors", checkForErrors));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDomainValidateBeforeCall(UUID id, Boolean checkForErrors, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getDomain(Async)");
}
return getDomainCall(id, checkForErrors, _callback);
}
/**
* Get a domain
* Returns domain verification status and tokens for a given domain
* @param id (required)
* @param checkForErrors (optional)
* @return DomainDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DomainDto getDomain(UUID id, Boolean checkForErrors) throws ApiException {
ApiResponse<DomainDto> localVarResp = getDomainWithHttpInfo(id, checkForErrors);
return localVarResp.getData();
}
/**
* Get a domain
* Returns domain verification status and tokens for a given domain
* @param id (required)
* @param checkForErrors (optional)
* @return ApiResponse<DomainDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DomainDto> getDomainWithHttpInfo(UUID id, Boolean checkForErrors) throws ApiException {
okhttp3.Call localVarCall = getDomainValidateBeforeCall(id, checkForErrors, null);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a domain (asynchronously)
* Returns domain verification status and tokens for a given domain
* @param id (required)
* @param checkForErrors (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainAsync(UUID id, Boolean checkForErrors, final ApiCallback<DomainDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getDomainValidateBeforeCall(id, checkForErrors, _callback);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getDomainIssues
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainIssuesCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/domains/issues";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDomainIssuesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getDomainIssuesCall(_callback);
}
/**
* Get domain issues
* List domain issues for domains you have created
* @return DomainIssuesDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DomainIssuesDto getDomainIssues() throws ApiException {
ApiResponse<DomainIssuesDto> localVarResp = getDomainIssuesWithHttpInfo();
return localVarResp.getData();
}
/**
* Get domain issues
* List domain issues for domains you have created
* @return ApiResponse<DomainIssuesDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DomainIssuesDto> getDomainIssuesWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getDomainIssuesValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<DomainIssuesDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get domain issues (asynchronously)
* List domain issues for domains you have created
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainIssuesAsync(final ApiCallback<DomainIssuesDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getDomainIssuesValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<DomainIssuesDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getDomainWildcardCatchAllInbox
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainWildcardCatchAllInboxCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/domains/{id}/wildcard"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDomainWildcardCatchAllInboxValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getDomainWildcardCatchAllInbox(Async)");
}
return getDomainWildcardCatchAllInboxCall(id, _callback);
}
/**
* Get catch all wild card inbox for domain
* Get the catch all inbox for a domain for missed emails
* @param id (required)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public InboxDto getDomainWildcardCatchAllInbox(UUID id) throws ApiException {
ApiResponse<InboxDto> localVarResp = getDomainWildcardCatchAllInboxWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get catch all wild card inbox for domain
* Get the catch all inbox for a domain for missed emails
* @param id (required)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> getDomainWildcardCatchAllInboxWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getDomainWildcardCatchAllInboxValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get catch all wild card inbox for domain (asynchronously)
* Get the catch all inbox for a domain for missed emails
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainWildcardCatchAllInboxAsync(UUID id, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getDomainWildcardCatchAllInboxValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getDomains
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/domains";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getDomainsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getDomainsCall(_callback);
}
/**
* Get domains
* List all custom domains you have created
* @return List<DomainPreview>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<DomainPreview> getDomains() throws ApiException {
ApiResponse<List<DomainPreview>> localVarResp = getDomainsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get domains
* List all custom domains you have created
* @return ApiResponse<List<DomainPreview>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<DomainPreview>> getDomainsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getDomainsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<DomainPreview>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get domains (asynchronously)
* List all custom domains you have created
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getDomainsAsync(final ApiCallback<List<DomainPreview>> _callback) throws ApiException {
okhttp3.Call localVarCall = getDomainsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<DomainPreview>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateDomain
* @param id (required)
* @param updateDomainOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateDomainCall(UUID id, UpdateDomainOptions updateDomainOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateDomainOptions;
// create path and map variables
String localVarPath = "/domains/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateDomainValidateBeforeCall(UUID id, UpdateDomainOptions updateDomainOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling updateDomain(Async)");
}
// verify the required parameter 'updateDomainOptions' is set
if (updateDomainOptions == null) {
throw new ApiException("Missing the required parameter 'updateDomainOptions' when calling updateDomain(Async)");
}
return updateDomainCall(id, updateDomainOptions, _callback);
}
/**
* Update a domain
* Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.
* @param id (required)
* @param updateDomainOptions (required)
* @return DomainDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DomainDto updateDomain(UUID id, UpdateDomainOptions updateDomainOptions) throws ApiException {
ApiResponse<DomainDto> localVarResp = updateDomainWithHttpInfo(id, updateDomainOptions);
return localVarResp.getData();
}
/**
* Update a domain
* Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.
* @param id (required)
* @param updateDomainOptions (required)
* @return ApiResponse<DomainDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DomainDto> updateDomainWithHttpInfo(UUID id, UpdateDomainOptions updateDomainOptions) throws ApiException {
okhttp3.Call localVarCall = updateDomainValidateBeforeCall(id, updateDomainOptions, null);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update a domain (asynchronously)
* Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.
* @param id (required)
* @param updateDomainOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateDomainAsync(UUID id, UpdateDomainOptions updateDomainOptions, final ApiCallback<DomainDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateDomainValidateBeforeCall(id, updateDomainOptions, _callback);
Type localVarReturnType = new TypeToken<DomainDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.ContactDto;
import com.mailslurp.models.ContactProjection;
import com.mailslurp.models.CreateContactOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageContactProjection;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class ContactControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ContactControllerApi() {
this(Configuration.getDefaultApiClient());
}
public ContactControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createContact
* @param createContactOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createContactCall(CreateContactOptions createContactOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createContactOptions;
// create path and map variables
String localVarPath = "/contacts";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createContactValidateBeforeCall(CreateContactOptions createContactOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createContactOptions' is set
if (createContactOptions == null) {
throw new ApiException("Missing the required parameter 'createContactOptions' when calling createContact(Async)");
}
return createContactCall(createContactOptions, _callback);
}
/**
* Create a contact
*
* @param createContactOptions (required)
* @return ContactDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ContactDto createContact(CreateContactOptions createContactOptions) throws ApiException {
ApiResponse<ContactDto> localVarResp = createContactWithHttpInfo(createContactOptions);
return localVarResp.getData();
}
/**
* Create a contact
*
* @param createContactOptions (required)
* @return ApiResponse<ContactDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<ContactDto> createContactWithHttpInfo(CreateContactOptions createContactOptions) throws ApiException {
okhttp3.Call localVarCall = createContactValidateBeforeCall(createContactOptions, null);
Type localVarReturnType = new TypeToken<ContactDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a contact (asynchronously)
*
* @param createContactOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createContactAsync(CreateContactOptions createContactOptions, final ApiCallback<ContactDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createContactValidateBeforeCall(createContactOptions, _callback);
Type localVarReturnType = new TypeToken<ContactDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteContact
* @param contactId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteContactCall(UUID contactId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/contacts/{contactId}"
.replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteContactValidateBeforeCall(UUID contactId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'contactId' is set
if (contactId == null) {
throw new ApiException("Missing the required parameter 'contactId' when calling deleteContact(Async)");
}
return deleteContactCall(contactId, _callback);
}
/**
* Delete contact
*
* @param contactId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteContact(UUID contactId) throws ApiException {
deleteContactWithHttpInfo(contactId);
}
/**
* Delete contact
*
* @param contactId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteContactWithHttpInfo(UUID contactId) throws ApiException {
okhttp3.Call localVarCall = deleteContactValidateBeforeCall(contactId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete contact (asynchronously)
*
* @param contactId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteContactAsync(UUID contactId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteContactValidateBeforeCall(contactId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllContacts
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllContactsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/contacts/paginated";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllContactsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllContactsCall(page, size, sort, since, before, _callback);
}
/**
* Get all contacts
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageContactProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageContactProjection getAllContacts(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageContactProjection> localVarResp = getAllContactsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get all contacts
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageContactProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageContactProjection> getAllContactsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllContactsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageContactProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all contacts (asynchronously)
*
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllContactsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageContactProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllContactsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageContactProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getContact
* @param contactId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getContactCall(UUID contactId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/contacts/{contactId}"
.replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getContactValidateBeforeCall(UUID contactId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'contactId' is set
if (contactId == null) {
throw new ApiException("Missing the required parameter 'contactId' when calling getContact(Async)");
}
return getContactCall(contactId, _callback);
}
/**
* Get contact
*
* @param contactId (required)
* @return ContactDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ContactDto getContact(UUID contactId) throws ApiException {
ApiResponse<ContactDto> localVarResp = getContactWithHttpInfo(contactId);
return localVarResp.getData();
}
/**
* Get contact
*
* @param contactId (required)
* @return ApiResponse<ContactDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ContactDto> getContactWithHttpInfo(UUID contactId) throws ApiException {
okhttp3.Call localVarCall = getContactValidateBeforeCall(contactId, null);
Type localVarReturnType = new TypeToken<ContactDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get contact (asynchronously)
*
* @param contactId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getContactAsync(UUID contactId, final ApiCallback<ContactDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getContactValidateBeforeCall(contactId, _callback);
Type localVarReturnType = new TypeToken<ContactDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getContactVCard
* @param contactId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getContactVCardCall(UUID contactId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/contacts/{contactId}/download"
.replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getContactVCardValidateBeforeCall(UUID contactId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'contactId' is set
if (contactId == null) {
throw new ApiException("Missing the required parameter 'contactId' when calling getContactVCard(Async)");
}
return getContactVCardCall(contactId, _callback);
}
/**
* Get contact vCard vcf file
*
* @param contactId (required)
* @return List<byte[]>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<byte[]> getContactVCard(UUID contactId) throws ApiException {
ApiResponse<List<byte[]>> localVarResp = getContactVCardWithHttpInfo(contactId);
return localVarResp.getData();
}
/**
* Get contact vCard vcf file
*
* @param contactId (required)
* @return ApiResponse<List<byte[]>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<byte[]>> getContactVCardWithHttpInfo(UUID contactId) throws ApiException {
okhttp3.Call localVarCall = getContactVCardValidateBeforeCall(contactId, null);
Type localVarReturnType = new TypeToken<List<byte[]>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get contact vCard vcf file (asynchronously)
*
* @param contactId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getContactVCardAsync(UUID contactId, final ApiCallback<List<byte[]>> _callback) throws ApiException {
okhttp3.Call localVarCall = getContactVCardValidateBeforeCall(contactId, _callback);
Type localVarReturnType = new TypeToken<List<byte[]>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getContacts
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getContactsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/contacts";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getContactsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getContactsCall(_callback);
}
/**
* Get all contacts
*
* @return List<ContactProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public List<ContactProjection> getContacts() throws ApiException {
ApiResponse<List<ContactProjection>> localVarResp = getContactsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get all contacts
*
* @return ApiResponse<List<ContactProjection>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<ContactProjection>> getContactsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getContactsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<List<ContactProjection>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all contacts (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getContactsAsync(final ApiCallback<List<ContactProjection>> _callback) throws ApiException {
okhttp3.Call localVarCall = getContactsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<List<ContactProjection>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.ConnectorDto;
import com.mailslurp.models.ConnectorSyncEventDto;
import com.mailslurp.models.ConnectorSyncRequestResult;
import com.mailslurp.models.CreateConnectorOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageConnector;
import com.mailslurp.models.PageConnectorSyncEvents;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class ConnectorControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ConnectorControllerApi() {
this(Configuration.getDefaultApiClient());
}
public ConnectorControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createConnector
* @param createConnectorOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createConnectorCall(CreateConnectorOptions createConnectorOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createConnectorOptions;
// create path and map variables
String localVarPath = "/connectors";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createConnectorValidateBeforeCall(CreateConnectorOptions createConnectorOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createConnectorOptions' is set
if (createConnectorOptions == null) {
throw new ApiException("Missing the required parameter 'createConnectorOptions' when calling createConnector(Async)");
}
return createConnectorCall(createConnectorOptions, _callback);
}
/**
* Create an inbox connector
* Sync emails between external mailboxes and MailSlurp inboxes
* @param createConnectorOptions (required)
* @return ConnectorDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ConnectorDto createConnector(CreateConnectorOptions createConnectorOptions) throws ApiException {
ApiResponse<ConnectorDto> localVarResp = createConnectorWithHttpInfo(createConnectorOptions);
return localVarResp.getData();
}
/**
* Create an inbox connector
* Sync emails between external mailboxes and MailSlurp inboxes
* @param createConnectorOptions (required)
* @return ApiResponse<ConnectorDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<ConnectorDto> createConnectorWithHttpInfo(CreateConnectorOptions createConnectorOptions) throws ApiException {
okhttp3.Call localVarCall = createConnectorValidateBeforeCall(createConnectorOptions, null);
Type localVarReturnType = new TypeToken<ConnectorDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an inbox connector (asynchronously)
* Sync emails between external mailboxes and MailSlurp inboxes
* @param createConnectorOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createConnectorAsync(CreateConnectorOptions createConnectorOptions, final ApiCallback<ConnectorDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createConnectorValidateBeforeCall(createConnectorOptions, _callback);
Type localVarReturnType = new TypeToken<ConnectorDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteConnector
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteConnectorCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteConnectorValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteConnector(Async)");
}
return deleteConnectorCall(id, _callback);
}
/**
* Delete an inbox connector
*
* @param id (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteConnector(UUID id) throws ApiException {
deleteConnectorWithHttpInfo(id);
}
/**
* Delete an inbox connector
*
* @param id (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteConnectorWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = deleteConnectorValidateBeforeCall(id, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an inbox connector (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteConnectorAsync(UUID id, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteConnectorValidateBeforeCall(id, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllConnectorSyncEvents
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllConnectorSyncEventsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors/events";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllConnectorSyncEventsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAllConnectorSyncEventsCall(page, size, sort, since, before, _callback);
}
/**
* Get all inbox connector sync events
*
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageConnectorSyncEvents
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageConnectorSyncEvents getAllConnectorSyncEvents(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageConnectorSyncEvents> localVarResp = getAllConnectorSyncEventsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get all inbox connector sync events
*
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageConnectorSyncEvents>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageConnectorSyncEvents> getAllConnectorSyncEventsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllConnectorSyncEventsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageConnectorSyncEvents>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all inbox connector sync events (asynchronously)
*
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAllConnectorSyncEventsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageConnectorSyncEvents> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllConnectorSyncEventsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageConnectorSyncEvents>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getConnector
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getConnectorValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getConnector(Async)");
}
return getConnectorCall(id, _callback);
}
/**
* Get an inbox connector
*
* @param id (required)
* @return ConnectorDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ConnectorDto getConnector(UUID id) throws ApiException {
ApiResponse<ConnectorDto> localVarResp = getConnectorWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get an inbox connector
*
* @param id (required)
* @return ApiResponse<ConnectorDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ConnectorDto> getConnectorWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getConnectorValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<ConnectorDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox connector (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorAsync(UUID id, final ApiCallback<ConnectorDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getConnectorValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<ConnectorDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getConnectorSyncEvent
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorSyncEventCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors/events/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getConnectorSyncEventValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getConnectorSyncEvent(Async)");
}
return getConnectorSyncEventCall(id, _callback);
}
/**
* Get an inbox connector sync event
*
* @param id (required)
* @return ConnectorSyncEventDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ConnectorSyncEventDto getConnectorSyncEvent(UUID id) throws ApiException {
ApiResponse<ConnectorSyncEventDto> localVarResp = getConnectorSyncEventWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get an inbox connector sync event
*
* @param id (required)
* @return ApiResponse<ConnectorSyncEventDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ConnectorSyncEventDto> getConnectorSyncEventWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getConnectorSyncEventValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<ConnectorSyncEventDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox connector sync event (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorSyncEventAsync(UUID id, final ApiCallback<ConnectorSyncEventDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getConnectorSyncEventValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<ConnectorSyncEventDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getConnectorSyncEvents
* @param id (required)
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorSyncEventsCall(UUID id, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors/{id}/events"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getConnectorSyncEventsValidateBeforeCall(UUID id, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getConnectorSyncEvents(Async)");
}
return getConnectorSyncEventsCall(id, page, size, sort, since, before, _callback);
}
/**
* Get an inbox connector sync events
*
* @param id (required)
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageConnectorSyncEvents
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageConnectorSyncEvents getConnectorSyncEvents(UUID id, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageConnectorSyncEvents> localVarResp = getConnectorSyncEventsWithHttpInfo(id, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get an inbox connector sync events
*
* @param id (required)
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageConnectorSyncEvents>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageConnectorSyncEvents> getConnectorSyncEventsWithHttpInfo(UUID id, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getConnectorSyncEventsValidateBeforeCall(id, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageConnectorSyncEvents>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an inbox connector sync events (asynchronously)
*
* @param id (required)
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorSyncEventsAsync(UUID id, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageConnectorSyncEvents> _callback) throws ApiException {
okhttp3.Call localVarCall = getConnectorSyncEventsValidateBeforeCall(id, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageConnectorSyncEvents>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getConnectors
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getConnectorsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getConnectorsCall(page, size, sort, since, before, _callback);
}
/**
* Get inbox connectors
* List inbox connectors that sync external emails to MailSlurp inboxes
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageConnector
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageConnector getConnectors(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageConnector> localVarResp = getConnectorsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get inbox connectors
* List inbox connectors that sync external emails to MailSlurp inboxes
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageConnector>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageConnector> getConnectorsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getConnectorsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageConnector>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get inbox connectors (asynchronously)
* List inbox connectors that sync external emails to MailSlurp inboxes
* @param page Optional page index in connector list pagination (optional, default to 0)
* @param size Optional page size in connector list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getConnectorsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageConnector> _callback) throws ApiException {
okhttp3.Call localVarCall = getConnectorsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageConnector>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for syncConnector
* @param id (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call syncConnectorCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/connectors/{id}/sync"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call syncConnectorValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling syncConnector(Async)");
}
return syncConnectorCall(id, _callback);
}
/**
* Sync an inbox connector
*
* @param id (required)
* @return ConnectorSyncRequestResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ConnectorSyncRequestResult syncConnector(UUID id) throws ApiException {
ApiResponse<ConnectorSyncRequestResult> localVarResp = syncConnectorWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Sync an inbox connector
*
* @param id (required)
* @return ApiResponse<ConnectorSyncRequestResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ConnectorSyncRequestResult> syncConnectorWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = syncConnectorValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<ConnectorSyncRequestResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Sync an inbox connector (asynchronously)
*
* @param id (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call syncConnectorAsync(UUID id, final ApiCallback<ConnectorSyncRequestResult> _callback) throws ApiException {
okhttp3.Call localVarCall = syncConnectorValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<ConnectorSyncRequestResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateConnector
* @param id (required)
* @param createConnectorOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateConnectorCall(UUID id, CreateConnectorOptions createConnectorOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createConnectorOptions;
// create path and map variables
String localVarPath = "/connectors/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateConnectorValidateBeforeCall(UUID id, CreateConnectorOptions createConnectorOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling updateConnector(Async)");
}
// verify the required parameter 'createConnectorOptions' is set
if (createConnectorOptions == null) {
throw new ApiException("Missing the required parameter 'createConnectorOptions' when calling updateConnector(Async)");
}
return updateConnectorCall(id, createConnectorOptions, _callback);
}
/**
* Update an inbox connector
*
* @param id (required)
* @param createConnectorOptions (required)
* @return ConnectorDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ConnectorDto updateConnector(UUID id, CreateConnectorOptions createConnectorOptions) throws ApiException {
ApiResponse<ConnectorDto> localVarResp = updateConnectorWithHttpInfo(id, createConnectorOptions);
return localVarResp.getData();
}
/**
* Update an inbox connector
*
* @param id (required)
* @param createConnectorOptions (required)
* @return ApiResponse<ConnectorDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<ConnectorDto> updateConnectorWithHttpInfo(UUID id, CreateConnectorOptions createConnectorOptions) throws ApiException {
okhttp3.Call localVarCall = updateConnectorValidateBeforeCall(id, createConnectorOptions, null);
Type localVarReturnType = new TypeToken<ConnectorDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update an inbox connector (asynchronously)
*
* @param id (required)
* @param createConnectorOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateConnectorAsync(UUID id, CreateConnectorOptions createConnectorOptions, final ApiCallback<ConnectorDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateConnectorValidateBeforeCall(id, createConnectorOptions, _callback);
Type localVarReturnType = new TypeToken<ConnectorDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.InboxDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.SimpleSendEmailOptions;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class CommonActionsControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public CommonActionsControllerApi() {
this(Configuration.getDefaultApiClient());
}
public CommonActionsControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createNewEmailAddress
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewEmailAddressCall(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/newEmailAddress";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (allowTeamAccess != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowTeamAccess", allowTeamAccess));
}
if (useDomainPool != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useDomainPool", useDomainPool));
}
if (expiresAt != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresAt", expiresAt));
}
if (expiresIn != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresIn", expiresIn));
}
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailAddress", emailAddress));
}
if (inboxType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxType", inboxType));
}
if (description != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("description", description));
}
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
if (tags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "tags", tags));
}
if (favourite != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("favourite", favourite));
}
if (virtualInbox != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("virtualInbox", virtualInbox));
}
if (useShortAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useShortAddress", useShortAddress));
}
if (domainName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainName", domainName));
}
if (domainId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainId", domainId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createNewEmailAddressValidateBeforeCall(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId, final ApiCallback _callback) throws ApiException {
return createNewEmailAddressCall(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId, _callback);
}
/**
* Create new random inbox
* Returns an Inbox with an `id` and an `emailAddress`
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public InboxDto createNewEmailAddress(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId) throws ApiException {
ApiResponse<InboxDto> localVarResp = createNewEmailAddressWithHttpInfo(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId);
return localVarResp.getData();
}
/**
* Create new random inbox
* Returns an Inbox with an `id` and an `emailAddress`
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> createNewEmailAddressWithHttpInfo(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId) throws ApiException {
okhttp3.Call localVarCall = createNewEmailAddressValidateBeforeCall(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create new random inbox (asynchronously)
* Returns an Inbox with an `id` and an `emailAddress`
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createNewEmailAddressAsync(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createNewEmailAddressValidateBeforeCall(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createRandomInbox
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createRandomInboxCall(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/createInbox";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (allowTeamAccess != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("allowTeamAccess", allowTeamAccess));
}
if (useDomainPool != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useDomainPool", useDomainPool));
}
if (expiresAt != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresAt", expiresAt));
}
if (expiresIn != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresIn", expiresIn));
}
if (emailAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailAddress", emailAddress));
}
if (inboxType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxType", inboxType));
}
if (description != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("description", description));
}
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
if (tags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "tags", tags));
}
if (favourite != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("favourite", favourite));
}
if (virtualInbox != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("virtualInbox", virtualInbox));
}
if (useShortAddress != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("useShortAddress", useShortAddress));
}
if (domainName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainName", domainName));
}
if (domainId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainId", domainId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createRandomInboxValidateBeforeCall(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId, final ApiCallback _callback) throws ApiException {
return createRandomInboxCall(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId, _callback);
}
/**
* Create new random inbox
* Returns an Inbox with an `id` and an `emailAddress`
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @return InboxDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public InboxDto createRandomInbox(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId) throws ApiException {
ApiResponse<InboxDto> localVarResp = createRandomInboxWithHttpInfo(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId);
return localVarResp.getData();
}
/**
* Create new random inbox
* Returns an Inbox with an `id` and an `emailAddress`
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @return ApiResponse<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<InboxDto> createRandomInboxWithHttpInfo(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId) throws ApiException {
okhttp3.Call localVarCall = createRandomInboxValidateBeforeCall(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId, null);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create new random inbox (asynchronously)
* Returns an Inbox with an `id` and an `emailAddress`
* @param allowTeamAccess (optional)
* @param useDomainPool (optional)
* @param expiresAt (optional)
* @param expiresIn (optional)
* @param emailAddress (optional)
* @param inboxType (optional)
* @param description (optional)
* @param name (optional)
* @param tags (optional)
* @param favourite (optional)
* @param virtualInbox (optional)
* @param useShortAddress (optional)
* @param domainName (optional)
* @param domainId (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createRandomInboxAsync(Boolean allowTeamAccess, Boolean useDomainPool, OffsetDateTime expiresAt, Long expiresIn, String emailAddress, String inboxType, String description, String name, List<String> tags, Boolean favourite, Boolean virtualInbox, Boolean useShortAddress, String domainName, UUID domainId, final ApiCallback<InboxDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createRandomInboxValidateBeforeCall(allowTeamAccess, useDomainPool, expiresAt, expiresIn, emailAddress, inboxType, description, name, tags, favourite, virtualInbox, useShortAddress, domainName, domainId, _callback);
Type localVarReturnType = new TypeToken<InboxDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteEmailAddress
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteEmailAddressCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/deleteEmailAddress";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteEmailAddressValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling deleteEmailAddress(Async)");
}
return deleteEmailAddressCall(inboxId, _callback);
}
/**
* Delete inbox email address by inbox id
* Deletes inbox email address
* @param inboxId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteEmailAddress(UUID inboxId) throws ApiException {
deleteEmailAddressWithHttpInfo(inboxId);
}
/**
* Delete inbox email address by inbox id
* Deletes inbox email address
* @param inboxId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteEmailAddressWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = deleteEmailAddressValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete inbox email address by inbox id (asynchronously)
* Deletes inbox email address
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteEmailAddressAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteEmailAddressValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for emptyInbox
* @param inboxId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call emptyInboxCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/emptyInbox";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (inboxId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("inboxId", inboxId));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call emptyInboxValidateBeforeCall(UUID inboxId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'inboxId' is set
if (inboxId == null) {
throw new ApiException("Missing the required parameter 'inboxId' when calling emptyInbox(Async)");
}
return emptyInboxCall(inboxId, _callback);
}
/**
* Delete all emails in an inbox
* Deletes all emails
* @param inboxId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void emptyInbox(UUID inboxId) throws ApiException {
emptyInboxWithHttpInfo(inboxId);
}
/**
* Delete all emails in an inbox
* Deletes all emails
* @param inboxId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> emptyInboxWithHttpInfo(UUID inboxId) throws ApiException {
okhttp3.Call localVarCall = emptyInboxValidateBeforeCall(inboxId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all emails in an inbox (asynchronously)
* Deletes all emails
* @param inboxId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call emptyInboxAsync(UUID inboxId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = emptyInboxValidateBeforeCall(inboxId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for sendEmailSimple
* @param simpleSendEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailSimpleCall(SimpleSendEmailOptions simpleSendEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = simpleSendEmailOptions;
// create path and map variables
String localVarPath = "/sendEmail";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendEmailSimpleValidateBeforeCall(SimpleSendEmailOptions simpleSendEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'simpleSendEmailOptions' is set
if (simpleSendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'simpleSendEmailOptions' when calling sendEmailSimple(Async)");
}
return sendEmailSimpleCall(simpleSendEmailOptions, _callback);
}
/**
* Send an email
* If no senderId or inboxId provided a random email address will be used to send from.
* @param simpleSendEmailOptions (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public void sendEmailSimple(SimpleSendEmailOptions simpleSendEmailOptions) throws ApiException {
sendEmailSimpleWithHttpInfo(simpleSendEmailOptions);
}
/**
* Send an email
* If no senderId or inboxId provided a random email address will be used to send from.
* @param simpleSendEmailOptions (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> sendEmailSimpleWithHttpInfo(SimpleSendEmailOptions simpleSendEmailOptions) throws ApiException {
okhttp3.Call localVarCall = sendEmailSimpleValidateBeforeCall(simpleSendEmailOptions, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Send an email (asynchronously)
* If no senderId or inboxId provided a random email address will be used to send from.
* @param simpleSendEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendEmailSimpleAsync(SimpleSendEmailOptions simpleSendEmailOptions, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = sendEmailSimpleValidateBeforeCall(simpleSendEmailOptions, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.BulkSendEmailOptions;
import com.mailslurp.models.InboxDto;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class BulkActionsControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public BulkActionsControllerApi() {
this(Configuration.getDefaultApiClient());
}
public BulkActionsControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for bulkCreateInboxes
* @param count Number of inboxes to be created in bulk (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call bulkCreateInboxesCall(Integer count, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bulk/inboxes";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (count != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", count));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call bulkCreateInboxesValidateBeforeCall(Integer count, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'count' is set
if (count == null) {
throw new ApiException("Missing the required parameter 'count' when calling bulkCreateInboxes(Async)");
}
return bulkCreateInboxesCall(count, _callback);
}
/**
* Bulk create Inboxes (email addresses)
*
* @param count Number of inboxes to be created in bulk (required)
* @return List<InboxDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public List<InboxDto> bulkCreateInboxes(Integer count) throws ApiException {
ApiResponse<List<InboxDto>> localVarResp = bulkCreateInboxesWithHttpInfo(count);
return localVarResp.getData();
}
/**
* Bulk create Inboxes (email addresses)
*
* @param count Number of inboxes to be created in bulk (required)
* @return ApiResponse<List<InboxDto>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<InboxDto>> bulkCreateInboxesWithHttpInfo(Integer count) throws ApiException {
okhttp3.Call localVarCall = bulkCreateInboxesValidateBeforeCall(count, null);
Type localVarReturnType = new TypeToken<List<InboxDto>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Bulk create Inboxes (email addresses) (asynchronously)
*
* @param count Number of inboxes to be created in bulk (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call bulkCreateInboxesAsync(Integer count, final ApiCallback<List<InboxDto>> _callback) throws ApiException {
okhttp3.Call localVarCall = bulkCreateInboxesValidateBeforeCall(count, _callback);
Type localVarReturnType = new TypeToken<List<InboxDto>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for bulkDeleteInboxes
* @param UUID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call bulkDeleteInboxesCall(List<UUID> UUID, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = UUID;
// create path and map variables
String localVarPath = "/bulk/inboxes";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call bulkDeleteInboxesValidateBeforeCall(List<UUID> UUID, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'UUID' is set
if (UUID == null) {
throw new ApiException("Missing the required parameter 'UUID' when calling bulkDeleteInboxes(Async)");
}
return bulkDeleteInboxesCall(UUID, _callback);
}
/**
* Bulk Delete Inboxes
*
* @param UUID (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void bulkDeleteInboxes(List<UUID> UUID) throws ApiException {
bulkDeleteInboxesWithHttpInfo(UUID);
}
/**
* Bulk Delete Inboxes
*
* @param UUID (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> bulkDeleteInboxesWithHttpInfo(List<UUID> UUID) throws ApiException {
okhttp3.Call localVarCall = bulkDeleteInboxesValidateBeforeCall(UUID, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Bulk Delete Inboxes (asynchronously)
*
* @param UUID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call bulkDeleteInboxesAsync(List<UUID> UUID, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = bulkDeleteInboxesValidateBeforeCall(UUID, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for bulkSendEmails
* @param bulkSendEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call bulkSendEmailsCall(BulkSendEmailOptions bulkSendEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = bulkSendEmailOptions;
// create path and map variables
String localVarPath = "/bulk/send";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call bulkSendEmailsValidateBeforeCall(BulkSendEmailOptions bulkSendEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'bulkSendEmailOptions' is set
if (bulkSendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'bulkSendEmailOptions' when calling bulkSendEmails(Async)");
}
return bulkSendEmailsCall(bulkSendEmailOptions, _callback);
}
/**
* Bulk Send Emails
*
* @param bulkSendEmailOptions (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public void bulkSendEmails(BulkSendEmailOptions bulkSendEmailOptions) throws ApiException {
bulkSendEmailsWithHttpInfo(bulkSendEmailOptions);
}
/**
* Bulk Send Emails
*
* @param bulkSendEmailOptions (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> bulkSendEmailsWithHttpInfo(BulkSendEmailOptions bulkSendEmailOptions) throws ApiException {
okhttp3.Call localVarCall = bulkSendEmailsValidateBeforeCall(bulkSendEmailOptions, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Bulk Send Emails (asynchronously)
*
* @param bulkSendEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call bulkSendEmailsAsync(BulkSendEmailOptions bulkSendEmailOptions, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = bulkSendEmailsValidateBeforeCall(bulkSendEmailOptions, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.BouncedEmailDto;
import com.mailslurp.models.BouncedRecipientDto;
import com.mailslurp.models.FilterBouncedRecipientsOptions;
import com.mailslurp.models.FilterBouncedRecipientsResult;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageBouncedEmail;
import com.mailslurp.models.PageBouncedRecipients;
import com.mailslurp.models.PageComplaint;
import com.mailslurp.models.PageListUnsubscribeRecipients;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class BounceControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public BounceControllerApi() {
this(Configuration.getDefaultApiClient());
}
public BounceControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for filterBouncedRecipient
* @param filterBouncedRecipientsOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call filterBouncedRecipientCall(FilterBouncedRecipientsOptions filterBouncedRecipientsOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = filterBouncedRecipientsOptions;
// create path and map variables
String localVarPath = "/bounce/filter-recipients";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call filterBouncedRecipientValidateBeforeCall(FilterBouncedRecipientsOptions filterBouncedRecipientsOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'filterBouncedRecipientsOptions' is set
if (filterBouncedRecipientsOptions == null) {
throw new ApiException("Missing the required parameter 'filterBouncedRecipientsOptions' when calling filterBouncedRecipient(Async)");
}
return filterBouncedRecipientCall(filterBouncedRecipientsOptions, _callback);
}
/**
* Filter a list of email recipients and remove those who have bounced
* Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints
* @param filterBouncedRecipientsOptions (required)
* @return FilterBouncedRecipientsResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public FilterBouncedRecipientsResult filterBouncedRecipient(FilterBouncedRecipientsOptions filterBouncedRecipientsOptions) throws ApiException {
ApiResponse<FilterBouncedRecipientsResult> localVarResp = filterBouncedRecipientWithHttpInfo(filterBouncedRecipientsOptions);
return localVarResp.getData();
}
/**
* Filter a list of email recipients and remove those who have bounced
* Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints
* @param filterBouncedRecipientsOptions (required)
* @return ApiResponse<FilterBouncedRecipientsResult>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<FilterBouncedRecipientsResult> filterBouncedRecipientWithHttpInfo(FilterBouncedRecipientsOptions filterBouncedRecipientsOptions) throws ApiException {
okhttp3.Call localVarCall = filterBouncedRecipientValidateBeforeCall(filterBouncedRecipientsOptions, null);
Type localVarReturnType = new TypeToken<FilterBouncedRecipientsResult>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Filter a list of email recipients and remove those who have bounced (asynchronously)
* Prevent email sending errors by remove recipients who have resulted in past email bounces or complaints
* @param filterBouncedRecipientsOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call filterBouncedRecipientAsync(FilterBouncedRecipientsOptions filterBouncedRecipientsOptions, final ApiCallback<FilterBouncedRecipientsResult> _callback) throws ApiException {
okhttp3.Call localVarCall = filterBouncedRecipientValidateBeforeCall(filterBouncedRecipientsOptions, _callback);
Type localVarReturnType = new TypeToken<FilterBouncedRecipientsResult>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBouncedEmail
* @param id ID of the bounced email to fetch (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedEmailCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bounce/emails/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBouncedEmailValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getBouncedEmail(Async)");
}
return getBouncedEmailCall(id, _callback);
}
/**
* Get a bounced email.
* Bounced emails are email you have sent that were rejected by a recipient
* @param id ID of the bounced email to fetch (required)
* @return BouncedEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public BouncedEmailDto getBouncedEmail(UUID id) throws ApiException {
ApiResponse<BouncedEmailDto> localVarResp = getBouncedEmailWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get a bounced email.
* Bounced emails are email you have sent that were rejected by a recipient
* @param id ID of the bounced email to fetch (required)
* @return ApiResponse<BouncedEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<BouncedEmailDto> getBouncedEmailWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getBouncedEmailValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<BouncedEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a bounced email. (asynchronously)
* Bounced emails are email you have sent that were rejected by a recipient
* @param id ID of the bounced email to fetch (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedEmailAsync(UUID id, final ApiCallback<BouncedEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getBouncedEmailValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<BouncedEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBouncedEmails
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedEmailsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bounce/emails";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBouncedEmailsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getBouncedEmailsCall(page, size, sort, since, before, _callback);
}
/**
* Get paginated list of bounced emails.
* Bounced emails are email you have sent that were rejected by a recipient
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageBouncedEmail
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageBouncedEmail getBouncedEmails(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageBouncedEmail> localVarResp = getBouncedEmailsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get paginated list of bounced emails.
* Bounced emails are email you have sent that were rejected by a recipient
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageBouncedEmail>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageBouncedEmail> getBouncedEmailsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getBouncedEmailsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageBouncedEmail>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get paginated list of bounced emails. (asynchronously)
* Bounced emails are email you have sent that were rejected by a recipient
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedEmailsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageBouncedEmail> _callback) throws ApiException {
okhttp3.Call localVarCall = getBouncedEmailsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageBouncedEmail>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBouncedRecipient
* @param id ID of the bounced recipient (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedRecipientCall(UUID id, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bounce/recipients/{id}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBouncedRecipientValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getBouncedRecipient(Async)");
}
return getBouncedRecipientCall(id, _callback);
}
/**
* Get a bounced email.
* Bounced emails are email you have sent that were rejected by a recipient
* @param id ID of the bounced recipient (required)
* @return BouncedRecipientDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public BouncedRecipientDto getBouncedRecipient(UUID id) throws ApiException {
ApiResponse<BouncedRecipientDto> localVarResp = getBouncedRecipientWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Get a bounced email.
* Bounced emails are email you have sent that were rejected by a recipient
* @param id ID of the bounced recipient (required)
* @return ApiResponse<BouncedRecipientDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<BouncedRecipientDto> getBouncedRecipientWithHttpInfo(UUID id) throws ApiException {
okhttp3.Call localVarCall = getBouncedRecipientValidateBeforeCall(id, null);
Type localVarReturnType = new TypeToken<BouncedRecipientDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a bounced email. (asynchronously)
* Bounced emails are email you have sent that were rejected by a recipient
* @param id ID of the bounced recipient (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedRecipientAsync(UUID id, final ApiCallback<BouncedRecipientDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getBouncedRecipientValidateBeforeCall(id, _callback);
Type localVarReturnType = new TypeToken<BouncedRecipientDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBouncedRecipients
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedRecipientsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bounce/recipients";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBouncedRecipientsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getBouncedRecipientsCall(page, size, sort, since, before, _callback);
}
/**
* Get paginated list of bounced recipients.
* Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageBouncedRecipients
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageBouncedRecipients getBouncedRecipients(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageBouncedRecipients> localVarResp = getBouncedRecipientsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get paginated list of bounced recipients.
* Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageBouncedRecipients>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageBouncedRecipients> getBouncedRecipientsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getBouncedRecipientsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageBouncedRecipients>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get paginated list of bounced recipients. (asynchronously)
* Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getBouncedRecipientsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageBouncedRecipients> _callback) throws ApiException {
okhttp3.Call localVarCall = getBouncedRecipientsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageBouncedRecipients>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getComplaints
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getComplaintsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bounce/complaints";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getComplaintsValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getComplaintsCall(page, size, sort, since, before, _callback);
}
/**
* Get paginated list of complaints.
* SMTP complaints made against your account
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageComplaint
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageComplaint getComplaints(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageComplaint> localVarResp = getComplaintsWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get paginated list of complaints.
* SMTP complaints made against your account
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageComplaint>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageComplaint> getComplaintsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getComplaintsValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageComplaint>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get paginated list of complaints. (asynchronously)
* SMTP complaints made against your account
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getComplaintsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageComplaint> _callback) throws ApiException {
okhttp3.Call localVarCall = getComplaintsValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageComplaint>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getListUnsubscribeRecipients
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param domainId Filter by domainId (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getListUnsubscribeRecipientsCall(Integer page, Integer size, String sort, UUID domainId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/bounce/list-unsubscribe-recipients";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (domainId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domainId", domainId));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getListUnsubscribeRecipientsValidateBeforeCall(Integer page, Integer size, String sort, UUID domainId, final ApiCallback _callback) throws ApiException {
return getListUnsubscribeRecipientsCall(page, size, sort, domainId, _callback);
}
/**
* Get paginated list of unsubscribed recipients.
* Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param domainId Filter by domainId (optional)
* @return PageListUnsubscribeRecipients
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageListUnsubscribeRecipients getListUnsubscribeRecipients(Integer page, Integer size, String sort, UUID domainId) throws ApiException {
ApiResponse<PageListUnsubscribeRecipients> localVarResp = getListUnsubscribeRecipientsWithHttpInfo(page, size, sort, domainId);
return localVarResp.getData();
}
/**
* Get paginated list of unsubscribed recipients.
* Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param domainId Filter by domainId (optional)
* @return ApiResponse<PageListUnsubscribeRecipients>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageListUnsubscribeRecipients> getListUnsubscribeRecipientsWithHttpInfo(Integer page, Integer size, String sort, UUID domainId) throws ApiException {
okhttp3.Call localVarCall = getListUnsubscribeRecipientsValidateBeforeCall(page, size, sort, domainId, null);
Type localVarReturnType = new TypeToken<PageListUnsubscribeRecipients>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get paginated list of unsubscribed recipients. (asynchronously)
* Unsubscribed recipient have unsubscribed from a mailing list for a user or domain and cannot be contacted again.
* @param page Optional page index (optional, default to 0)
* @param size Optional page size (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param domainId Filter by domainId (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getListUnsubscribeRecipientsAsync(Integer page, Integer size, String sort, UUID domainId, final ApiCallback<PageListUnsubscribeRecipients> _callback) throws ApiException {
okhttp3.Call localVarCall = getListUnsubscribeRecipientsValidateBeforeCall(page, size, sort, domainId, _callback);
Type localVarReturnType = new TypeToken<PageListUnsubscribeRecipients>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.AttachmentEntity;
import com.mailslurp.models.AttachmentMetaData;
import com.mailslurp.models.DownloadAttachmentDto;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageAttachmentEntity;
import com.mailslurp.models.UploadAttachmentBytesRequest;
import com.mailslurp.models.UploadAttachmentOptions;
import com.mailslurp.models.UploadMultipartFormRequest;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class AttachmentControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AttachmentControllerApi() {
this(Configuration.getDefaultApiClient());
}
public AttachmentControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for deleteAllAttachments
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllAttachmentsCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAllAttachmentsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return deleteAllAttachmentsCall(_callback);
}
/**
* Delete all attachments
*
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAllAttachments() throws ApiException {
deleteAllAttachmentsWithHttpInfo();
}
/**
* Delete all attachments
*
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAllAttachmentsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = deleteAllAttachmentsValidateBeforeCall(null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete all attachments (asynchronously)
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAllAttachmentsAsync(final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAllAttachmentsValidateBeforeCall(_callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for deleteAttachment
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAttachmentCall(String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments/{attachmentId}"
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAttachmentValidateBeforeCall(String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling deleteAttachment(Async)");
}
return deleteAttachmentCall(attachmentId, _callback);
}
/**
* Delete an attachment
*
* @param attachmentId ID of attachment (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAttachment(String attachmentId) throws ApiException {
deleteAttachmentWithHttpInfo(attachmentId);
}
/**
* Delete an attachment
*
* @param attachmentId ID of attachment (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAttachmentWithHttpInfo(String attachmentId) throws ApiException {
okhttp3.Call localVarCall = deleteAttachmentValidateBeforeCall(attachmentId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an attachment (asynchronously)
*
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAttachmentAsync(String attachmentId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAttachmentValidateBeforeCall(attachmentId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for downloadAttachmentAsBase64Encoded
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentAsBase64EncodedCall(String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments/{attachmentId}/base64"
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call downloadAttachmentAsBase64EncodedValidateBeforeCall(String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling downloadAttachmentAsBase64Encoded(Async)");
}
return downloadAttachmentAsBase64EncodedCall(attachmentId, _callback);
}
/**
* Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
* Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
* @param attachmentId ID of attachment (required)
* @return DownloadAttachmentDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public DownloadAttachmentDto downloadAttachmentAsBase64Encoded(String attachmentId) throws ApiException {
ApiResponse<DownloadAttachmentDto> localVarResp = downloadAttachmentAsBase64EncodedWithHttpInfo(attachmentId);
return localVarResp.getData();
}
/**
* Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
* Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
* @param attachmentId ID of attachment (required)
* @return ApiResponse<DownloadAttachmentDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<DownloadAttachmentDto> downloadAttachmentAsBase64EncodedWithHttpInfo(String attachmentId) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentAsBase64EncodedValidateBeforeCall(attachmentId, null);
Type localVarReturnType = new TypeToken<DownloadAttachmentDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents. (asynchronously)
* Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentAsBase64EncodedAsync(String attachmentId, final ApiCallback<DownloadAttachmentDto> _callback) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentAsBase64EncodedValidateBeforeCall(attachmentId, _callback);
Type localVarReturnType = new TypeToken<DownloadAttachmentDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for downloadAttachmentAsBytes
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentAsBytesCall(String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments/{attachmentId}/bytes"
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/octet-stream"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call downloadAttachmentAsBytesValidateBeforeCall(String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling downloadAttachmentAsBytes(Async)");
}
return downloadAttachmentAsBytesCall(attachmentId, _callback);
}
/**
* Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
* Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
* @param attachmentId ID of attachment (required)
* @return byte[]
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public byte[] downloadAttachmentAsBytes(String attachmentId) throws ApiException {
ApiResponse<byte[]> localVarResp = downloadAttachmentAsBytesWithHttpInfo(attachmentId);
return localVarResp.getData();
}
/**
* Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
* Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
* @param attachmentId ID of attachment (required)
* @return ApiResponse<byte[]>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<byte[]> downloadAttachmentAsBytesWithHttpInfo(String attachmentId) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentAsBytesValidateBeforeCall(attachmentId, null);
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints. (asynchronously)
* Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call downloadAttachmentAsBytesAsync(String attachmentId, final ApiCallback<byte[]> _callback) throws ApiException {
okhttp3.Call localVarCall = downloadAttachmentAsBytesValidateBeforeCall(attachmentId, _callback);
Type localVarReturnType = new TypeToken<byte[]>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAttachment
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentCall(String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments/{attachmentId}"
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAttachmentValidateBeforeCall(String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling getAttachment(Async)");
}
return getAttachmentCall(attachmentId, _callback);
}
/**
* Get an attachment entity
*
* @param attachmentId ID of attachment (required)
* @return AttachmentEntity
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public AttachmentEntity getAttachment(String attachmentId) throws ApiException {
ApiResponse<AttachmentEntity> localVarResp = getAttachmentWithHttpInfo(attachmentId);
return localVarResp.getData();
}
/**
* Get an attachment entity
*
* @param attachmentId ID of attachment (required)
* @return ApiResponse<AttachmentEntity>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<AttachmentEntity> getAttachmentWithHttpInfo(String attachmentId) throws ApiException {
okhttp3.Call localVarCall = getAttachmentValidateBeforeCall(attachmentId, null);
Type localVarReturnType = new TypeToken<AttachmentEntity>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an attachment entity (asynchronously)
*
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentAsync(String attachmentId, final ApiCallback<AttachmentEntity> _callback) throws ApiException {
okhttp3.Call localVarCall = getAttachmentValidateBeforeCall(attachmentId, _callback);
Type localVarReturnType = new TypeToken<AttachmentEntity>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAttachmentInfo
* @param attachmentId ID of attachment (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentInfoCall(String attachmentId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments/{attachmentId}/metadata"
.replace("{" + "attachmentId" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAttachmentInfoValidateBeforeCall(String attachmentId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling getAttachmentInfo(Async)");
}
return getAttachmentInfoCall(attachmentId, _callback);
}
/**
* Get email attachment metadata information
* Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
* @param attachmentId ID of attachment (required)
* @return AttachmentMetaData
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public AttachmentMetaData getAttachmentInfo(String attachmentId) throws ApiException {
ApiResponse<AttachmentMetaData> localVarResp = getAttachmentInfoWithHttpInfo(attachmentId);
return localVarResp.getData();
}
/**
* Get email attachment metadata information
* Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
* @param attachmentId ID of attachment (required)
* @return ApiResponse<AttachmentMetaData>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<AttachmentMetaData> getAttachmentInfoWithHttpInfo(String attachmentId) throws ApiException {
okhttp3.Call localVarCall = getAttachmentInfoValidateBeforeCall(attachmentId, null);
Type localVarReturnType = new TypeToken<AttachmentMetaData>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email attachment metadata information (asynchronously)
* Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
* @param attachmentId ID of attachment (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentInfoAsync(String attachmentId, final ApiCallback<AttachmentMetaData> _callback) throws ApiException {
okhttp3.Call localVarCall = getAttachmentInfoValidateBeforeCall(attachmentId, _callback);
Type localVarReturnType = new TypeToken<AttachmentMetaData>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAttachments
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param fileNameFilter Optional file name and content type search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentsCall(Integer page, Integer size, String sort, String fileNameFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/attachments";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (fileNameFilter != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("fileNameFilter", fileNameFilter));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAttachmentsValidateBeforeCall(Integer page, Integer size, String sort, String fileNameFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAttachmentsCall(page, size, sort, fileNameFilter, since, before, _callback);
}
/**
* Get email attachments
* Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents.
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param fileNameFilter Optional file name and content type search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageAttachmentEntity
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageAttachmentEntity getAttachments(Integer page, Integer size, String sort, String fileNameFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageAttachmentEntity> localVarResp = getAttachmentsWithHttpInfo(page, size, sort, fileNameFilter, since, before);
return localVarResp.getData();
}
/**
* Get email attachments
* Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents.
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param fileNameFilter Optional file name and content type search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageAttachmentEntity>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageAttachmentEntity> getAttachmentsWithHttpInfo(Integer page, Integer size, String sort, String fileNameFilter, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAttachmentsValidateBeforeCall(page, size, sort, fileNameFilter, since, before, null);
Type localVarReturnType = new TypeToken<PageAttachmentEntity>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get email attachments (asynchronously)
* Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents.
* @param page Optional page index for list pagination (optional, default to 0)
* @param size Optional page size for list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param fileNameFilter Optional file name and content type search filter (optional)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAttachmentsAsync(Integer page, Integer size, String sort, String fileNameFilter, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageAttachmentEntity> _callback) throws ApiException {
okhttp3.Call localVarCall = getAttachmentsValidateBeforeCall(page, size, sort, fileNameFilter, since, before, _callback);
Type localVarReturnType = new TypeToken<PageAttachmentEntity>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for uploadAttachment
* @param uploadAttachmentOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call uploadAttachmentCall(UploadAttachmentOptions uploadAttachmentOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = uploadAttachmentOptions;
// create path and map variables
String localVarPath = "/attachments";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call uploadAttachmentValidateBeforeCall(UploadAttachmentOptions uploadAttachmentOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uploadAttachmentOptions' is set
if (uploadAttachmentOptions == null) {
throw new ApiException("Missing the required parameter 'uploadAttachmentOptions' when calling uploadAttachment(Async)");
}
return uploadAttachmentCall(uploadAttachmentOptions, _callback);
}
/**
* Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
*
* @param uploadAttachmentOptions (required)
* @return List<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public List<String> uploadAttachment(UploadAttachmentOptions uploadAttachmentOptions) throws ApiException {
ApiResponse<List<String>> localVarResp = uploadAttachmentWithHttpInfo(uploadAttachmentOptions);
return localVarResp.getData();
}
/**
* Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
*
* @param uploadAttachmentOptions (required)
* @return ApiResponse<List<String>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<String>> uploadAttachmentWithHttpInfo(UploadAttachmentOptions uploadAttachmentOptions) throws ApiException {
okhttp3.Call localVarCall = uploadAttachmentValidateBeforeCall(uploadAttachmentOptions, null);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. (asynchronously)
*
* @param uploadAttachmentOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call uploadAttachmentAsync(UploadAttachmentOptions uploadAttachmentOptions, final ApiCallback<List<String>> _callback) throws ApiException {
okhttp3.Call localVarCall = uploadAttachmentValidateBeforeCall(uploadAttachmentOptions, _callback);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for uploadAttachmentBytes
* @param uploadAttachmentBytesRequest (required)
* @param contentType Optional contentType for file. For instance `application/pdf` (optional)
* @param filename Optional filename to save upload with (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call uploadAttachmentBytesCall(UploadAttachmentBytesRequest uploadAttachmentBytesRequest, String contentType, String filename, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = uploadAttachmentBytesRequest;
// create path and map variables
String localVarPath = "/attachments/bytes";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (filename != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("filename", filename));
}
if (contentType != null) {
localVarHeaderParams.put("contentType", localVarApiClient.parameterToString(contentType));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/octet-stream"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call uploadAttachmentBytesValidateBeforeCall(UploadAttachmentBytesRequest uploadAttachmentBytesRequest, String contentType, String filename, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uploadAttachmentBytesRequest' is set
if (uploadAttachmentBytesRequest == null) {
throw new ApiException("Missing the required parameter 'uploadAttachmentBytesRequest' when calling uploadAttachmentBytes(Async)");
}
return uploadAttachmentBytesCall(uploadAttachmentBytesRequest, contentType, filename, _callback);
}
/**
* Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
*
* @param uploadAttachmentBytesRequest (required)
* @param contentType Optional contentType for file. For instance `application/pdf` (optional)
* @param filename Optional filename to save upload with (optional)
* @return List<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public List<String> uploadAttachmentBytes(UploadAttachmentBytesRequest uploadAttachmentBytesRequest, String contentType, String filename) throws ApiException {
ApiResponse<List<String>> localVarResp = uploadAttachmentBytesWithHttpInfo(uploadAttachmentBytesRequest, contentType, filename);
return localVarResp.getData();
}
/**
* Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
*
* @param uploadAttachmentBytesRequest (required)
* @param contentType Optional contentType for file. For instance `application/pdf` (optional)
* @param filename Optional filename to save upload with (optional)
* @return ApiResponse<List<String>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<String>> uploadAttachmentBytesWithHttpInfo(UploadAttachmentBytesRequest uploadAttachmentBytesRequest, String contentType, String filename) throws ApiException {
okhttp3.Call localVarCall = uploadAttachmentBytesValidateBeforeCall(uploadAttachmentBytesRequest, contentType, filename, null);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment. (asynchronously)
*
* @param uploadAttachmentBytesRequest (required)
* @param contentType Optional contentType for file. For instance `application/pdf` (optional)
* @param filename Optional filename to save upload with (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call uploadAttachmentBytesAsync(UploadAttachmentBytesRequest uploadAttachmentBytesRequest, String contentType, String filename, final ApiCallback<List<String>> _callback) throws ApiException {
okhttp3.Call localVarCall = uploadAttachmentBytesValidateBeforeCall(uploadAttachmentBytesRequest, contentType, filename, _callback);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for uploadMultipartForm
* @param contentType Optional content type of attachment (optional)
* @param filename Optional name of file (optional)
* @param xFilename Optional content type header of attachment (optional)
* @param uploadMultipartFormRequest (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call uploadMultipartFormCall(String contentType, String filename, String xFilename, UploadMultipartFormRequest uploadMultipartFormRequest, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = uploadMultipartFormRequest;
// create path and map variables
String localVarPath = "/attachments/multipart";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (contentType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("contentType", contentType));
}
if (filename != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("filename", filename));
}
if (xFilename != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("x-filename", xFilename));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call uploadMultipartFormValidateBeforeCall(String contentType, String filename, String xFilename, UploadMultipartFormRequest uploadMultipartFormRequest, final ApiCallback _callback) throws ApiException {
return uploadMultipartFormCall(contentType, filename, xFilename, uploadMultipartFormRequest, _callback);
}
/**
* Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
*
* @param contentType Optional content type of attachment (optional)
* @param filename Optional name of file (optional)
* @param xFilename Optional content type header of attachment (optional)
* @param uploadMultipartFormRequest (optional)
* @return List<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public List<String> uploadMultipartForm(String contentType, String filename, String xFilename, UploadMultipartFormRequest uploadMultipartFormRequest) throws ApiException {
ApiResponse<List<String>> localVarResp = uploadMultipartFormWithHttpInfo(contentType, filename, xFilename, uploadMultipartFormRequest);
return localVarResp.getData();
}
/**
* Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
*
* @param contentType Optional content type of attachment (optional)
* @param filename Optional name of file (optional)
* @param xFilename Optional content type header of attachment (optional)
* @param uploadMultipartFormRequest (optional)
* @return ApiResponse<List<String>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<List<String>> uploadMultipartFormWithHttpInfo(String contentType, String filename, String xFilename, UploadMultipartFormRequest uploadMultipartFormRequest) throws ApiException {
okhttp3.Call localVarCall = uploadMultipartFormValidateBeforeCall(contentType, filename, xFilename, uploadMultipartFormRequest, null);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. (asynchronously)
*
* @param contentType Optional content type of attachment (optional)
* @param filename Optional name of file (optional)
* @param xFilename Optional content type header of attachment (optional)
* @param uploadMultipartFormRequest (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call uploadMultipartFormAsync(String contentType, String filename, String xFilename, UploadMultipartFormRequest uploadMultipartFormRequest, final ApiCallback<List<String>> _callback) throws ApiException {
okhttp3.Call localVarCall = uploadMultipartFormValidateBeforeCall(contentType, filename, xFilename, uploadMultipartFormRequest, _callback);
Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
/*
* 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: contact@mailslurp.dev
*
* 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.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.AliasDto;
import com.mailslurp.models.CreateAliasOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageAlias;
import com.mailslurp.models.PageEmailProjection;
import com.mailslurp.models.PageThreadProjection;
import com.mailslurp.models.ReplyToAliasEmailOptions;
import com.mailslurp.models.SendEmailOptions;
import com.mailslurp.models.SentEmailDto;
import java.util.UUID;
import com.mailslurp.models.UpdateAliasOptions;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class AliasControllerApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AliasControllerApi() {
this(Configuration.getDefaultApiClient());
}
public AliasControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createAlias
* @param createAliasOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createAliasCall(CreateAliasOptions createAliasOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = createAliasOptions;
// create path and map variables
String localVarPath = "/aliases";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createAliasValidateBeforeCall(CreateAliasOptions createAliasOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createAliasOptions' is set
if (createAliasOptions == null) {
throw new ApiException("Missing the required parameter 'createAliasOptions' when calling createAlias(Async)");
}
return createAliasCall(createAliasOptions, _callback);
}
/**
* Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
* Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
* @param createAliasOptions (required)
* @return AliasDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public AliasDto createAlias(CreateAliasOptions createAliasOptions) throws ApiException {
ApiResponse<AliasDto> localVarResp = createAliasWithHttpInfo(createAliasOptions);
return localVarResp.getData();
}
/**
* Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
* Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
* @param createAliasOptions (required)
* @return ApiResponse<AliasDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public ApiResponse<AliasDto> createAliasWithHttpInfo(CreateAliasOptions createAliasOptions) throws ApiException {
okhttp3.Call localVarCall = createAliasValidateBeforeCall(createAliasOptions, null);
Type localVarReturnType = new TypeToken<AliasDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active. (asynchronously)
* Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
* @param createAliasOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createAliasAsync(CreateAliasOptions createAliasOptions, final ApiCallback<AliasDto> _callback) throws ApiException {
okhttp3.Call localVarCall = createAliasValidateBeforeCall(createAliasOptions, _callback);
Type localVarReturnType = new TypeToken<AliasDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteAlias
* @param aliasId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAliasCall(UUID aliasId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/aliases/{aliasId}"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAliasValidateBeforeCall(UUID aliasId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling deleteAlias(Async)");
}
return deleteAliasCall(aliasId, _callback);
}
/**
* Delete an email alias
*
* @param aliasId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public void deleteAlias(UUID aliasId) throws ApiException {
deleteAliasWithHttpInfo(aliasId);
}
/**
* Delete an email alias
*
* @param aliasId (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public ApiResponse<Void> deleteAliasWithHttpInfo(UUID aliasId) throws ApiException {
okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(aliasId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete an email alias (asynchronously)
*
* @param aliasId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 204 </td><td> No Content </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deleteAliasAsync(UUID aliasId, final ApiCallback<Void> _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAliasValidateBeforeCall(aliasId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAlias
* @param aliasId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasCall(UUID aliasId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/aliases/{aliasId}"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAliasValidateBeforeCall(UUID aliasId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling getAlias(Async)");
}
return getAliasCall(aliasId, _callback);
}
/**
* Get an email alias
* Get an email alias by ID
* @param aliasId (required)
* @return AliasDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public AliasDto getAlias(UUID aliasId) throws ApiException {
ApiResponse<AliasDto> localVarResp = getAliasWithHttpInfo(aliasId);
return localVarResp.getData();
}
/**
* Get an email alias
* Get an email alias by ID
* @param aliasId (required)
* @return ApiResponse<AliasDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<AliasDto> getAliasWithHttpInfo(UUID aliasId) throws ApiException {
okhttp3.Call localVarCall = getAliasValidateBeforeCall(aliasId, null);
Type localVarReturnType = new TypeToken<AliasDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an email alias (asynchronously)
* Get an email alias by ID
* @param aliasId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasAsync(UUID aliasId, final ApiCallback<AliasDto> _callback) throws ApiException {
okhttp3.Call localVarCall = getAliasValidateBeforeCall(aliasId, _callback);
Type localVarReturnType = new TypeToken<AliasDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAliasEmails
* @param aliasId (required)
* @param page Optional page index alias email list pagination (optional, default to 0)
* @param size Optional page size alias email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasEmailsCall(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/aliases/{aliasId}/emails"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAliasEmailsValidateBeforeCall(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling getAliasEmails(Async)");
}
return getAliasEmailsCall(aliasId, page, size, sort, since, before, _callback);
}
/**
* Get emails for an alias
* Get paginated emails for an alias by ID
* @param aliasId (required)
* @param page Optional page index alias email list pagination (optional, default to 0)
* @param size Optional page size alias email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @return PageEmailProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageEmailProjection getAliasEmails(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageEmailProjection> localVarResp = getAliasEmailsWithHttpInfo(aliasId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get emails for an alias
* Get paginated emails for an alias by ID
* @param aliasId (required)
* @param page Optional page index alias email list pagination (optional, default to 0)
* @param size Optional page size alias email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @return ApiResponse<PageEmailProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageEmailProjection> getAliasEmailsWithHttpInfo(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAliasEmailsValidateBeforeCall(aliasId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageEmailProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get emails for an alias (asynchronously)
* Get paginated emails for an alias by ID
* @param aliasId (required)
* @param page Optional page index alias email list pagination (optional, default to 0)
* @param size Optional page size alias email list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasEmailsAsync(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageEmailProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAliasEmailsValidateBeforeCall(aliasId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageEmailProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAliasThreads
* @param aliasId (required)
* @param page Optional page index in thread list pagination (optional, default to 0)
* @param size Optional page size in thread list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasThreadsCall(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/aliases/{aliasId}/threads"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAliasThreadsValidateBeforeCall(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling getAliasThreads(Async)");
}
return getAliasThreadsCall(aliasId, page, size, sort, since, before, _callback);
}
/**
* Get threads created for an alias
* Returns threads created for an email alias in paginated form
* @param aliasId (required)
* @param page Optional page index in thread list pagination (optional, default to 0)
* @param size Optional page size in thread list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @return PageThreadProjection
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageThreadProjection getAliasThreads(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageThreadProjection> localVarResp = getAliasThreadsWithHttpInfo(aliasId, page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get threads created for an alias
* Returns threads created for an email alias in paginated form
* @param aliasId (required)
* @param page Optional page index in thread list pagination (optional, default to 0)
* @param size Optional page size in thread list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @return ApiResponse<PageThreadProjection>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageThreadProjection> getAliasThreadsWithHttpInfo(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAliasThreadsValidateBeforeCall(aliasId, page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageThreadProjection>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get threads created for an alias (asynchronously)
* Returns threads created for an email alias in paginated form
* @param aliasId (required)
* @param page Optional page index in thread list pagination (optional, default to 0)
* @param size Optional page size in thread list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Optional filter by sent after given date time (optional)
* @param before Optional filter by sent before given date time (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasThreadsAsync(UUID aliasId, Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageThreadProjection> _callback) throws ApiException {
okhttp3.Call localVarCall = getAliasThreadsValidateBeforeCall(aliasId, page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageThreadProjection>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getAliases
* @param page Optional page index in alias list pagination (optional, default to 0)
* @param size Optional page size in alias list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasesCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/aliases";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAliasesValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
return getAliasesCall(page, size, sort, since, before, _callback);
}
/**
* Get all email aliases you have created
* Get all email aliases in paginated form
* @param page Optional page index in alias list pagination (optional, default to 0)
* @param size Optional page size in alias list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageAlias
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public PageAlias getAliases(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse<PageAlias> localVarResp = getAliasesWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* Get all email aliases you have created
* Get all email aliases in paginated form
* @param page Optional page index in alias list pagination (optional, default to 0)
* @param size Optional page size in alias list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageAlias>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<PageAlias> getAliasesWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAliasesValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken<PageAlias>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all email aliases you have created (asynchronously)
* Get all email aliases in paginated form
* @param page Optional page index in alias list pagination (optional, default to 0)
* @param size Optional page size in alias list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAliasesAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback<PageAlias> _callback) throws ApiException {
okhttp3.Call localVarCall = getAliasesValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken<PageAlias>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for replyToAliasEmail
* @param aliasId ID of the alias that email belongs to (required)
* @param emailId ID of the email that should be replied to (required)
* @param replyToAliasEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call replyToAliasEmailCall(UUID aliasId, UUID emailId, ReplyToAliasEmailOptions replyToAliasEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = replyToAliasEmailOptions;
// create path and map variables
String localVarPath = "/aliases/{aliasId}/emails/{emailId}"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()))
.replace("{" + "emailId" + "}", localVarApiClient.escapeString(emailId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call replyToAliasEmailValidateBeforeCall(UUID aliasId, UUID emailId, ReplyToAliasEmailOptions replyToAliasEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling replyToAliasEmail(Async)");
}
// verify the required parameter 'emailId' is set
if (emailId == null) {
throw new ApiException("Missing the required parameter 'emailId' when calling replyToAliasEmail(Async)");
}
// verify the required parameter 'replyToAliasEmailOptions' is set
if (replyToAliasEmailOptions == null) {
throw new ApiException("Missing the required parameter 'replyToAliasEmailOptions' when calling replyToAliasEmail(Async)");
}
return replyToAliasEmailCall(aliasId, emailId, replyToAliasEmailOptions, _callback);
}
/**
* Reply to an email
* Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
* @param aliasId ID of the alias that email belongs to (required)
* @param emailId ID of the email that should be replied to (required)
* @param replyToAliasEmailOptions (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SentEmailDto replyToAliasEmail(UUID aliasId, UUID emailId, ReplyToAliasEmailOptions replyToAliasEmailOptions) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = replyToAliasEmailWithHttpInfo(aliasId, emailId, replyToAliasEmailOptions);
return localVarResp.getData();
}
/**
* Reply to an email
* Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
* @param aliasId ID of the alias that email belongs to (required)
* @param emailId ID of the email that should be replied to (required)
* @param replyToAliasEmailOptions (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> replyToAliasEmailWithHttpInfo(UUID aliasId, UUID emailId, ReplyToAliasEmailOptions replyToAliasEmailOptions) throws ApiException {
okhttp3.Call localVarCall = replyToAliasEmailValidateBeforeCall(aliasId, emailId, replyToAliasEmailOptions, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Reply to an email (asynchronously)
* Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
* @param aliasId ID of the alias that email belongs to (required)
* @param emailId ID of the email that should be replied to (required)
* @param replyToAliasEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call replyToAliasEmailAsync(UUID aliasId, UUID emailId, ReplyToAliasEmailOptions replyToAliasEmailOptions, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = replyToAliasEmailValidateBeforeCall(aliasId, emailId, replyToAliasEmailOptions, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for sendAliasEmail
* @param aliasId (required)
* @param sendEmailOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendAliasEmailCall(UUID aliasId, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = sendEmailOptions;
// create path and map variables
String localVarPath = "/aliases/{aliasId}/emails"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call sendAliasEmailValidateBeforeCall(UUID aliasId, SendEmailOptions sendEmailOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling sendAliasEmail(Async)");
}
// verify the required parameter 'sendEmailOptions' is set
if (sendEmailOptions == null) {
throw new ApiException("Missing the required parameter 'sendEmailOptions' when calling sendAliasEmail(Async)");
}
return sendAliasEmailCall(aliasId, sendEmailOptions, _callback);
}
/**
* Send an email from an alias inbox
* Send an email from an alias. Replies to the email will be forwarded to the alias masked email address
* @param aliasId (required)
* @param sendEmailOptions (required)
* @return SentEmailDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public SentEmailDto sendAliasEmail(UUID aliasId, SendEmailOptions sendEmailOptions) throws ApiException {
ApiResponse<SentEmailDto> localVarResp = sendAliasEmailWithHttpInfo(aliasId, sendEmailOptions);
return localVarResp.getData();
}
/**
* Send an email from an alias inbox
* Send an email from an alias. Replies to the email will be forwarded to the alias masked email address
* @param aliasId (required)
* @param sendEmailOptions (required)
* @return ApiResponse<SentEmailDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public ApiResponse<SentEmailDto> sendAliasEmailWithHttpInfo(UUID aliasId, SendEmailOptions sendEmailOptions) throws ApiException {
okhttp3.Call localVarCall = sendAliasEmailValidateBeforeCall(aliasId, sendEmailOptions, null);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Send an email from an alias inbox (asynchronously)
* Send an email from an alias. Replies to the email will be forwarded to the alias masked email address
* @param aliasId (required)
* @param sendEmailOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> OK </td><td> - </td></tr>
</table>
*/
public okhttp3.Call sendAliasEmailAsync(UUID aliasId, SendEmailOptions sendEmailOptions, final ApiCallback<SentEmailDto> _callback) throws ApiException {
okhttp3.Call localVarCall = sendAliasEmailValidateBeforeCall(aliasId, sendEmailOptions, _callback);
Type localVarReturnType = new TypeToken<SentEmailDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateAlias
* @param aliasId (required)
* @param updateAliasOptions (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateAliasCall(UUID aliasId, UpdateAliasOptions updateAliasOptions, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = updateAliasOptions;
// create path and map variables
String localVarPath = "/aliases/{aliasId}"
.replace("{" + "aliasId" + "}", localVarApiClient.escapeString(aliasId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateAliasValidateBeforeCall(UUID aliasId, UpdateAliasOptions updateAliasOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'aliasId' is set
if (aliasId == null) {
throw new ApiException("Missing the required parameter 'aliasId' when calling updateAlias(Async)");
}
// verify the required parameter 'updateAliasOptions' is set
if (updateAliasOptions == null) {
throw new ApiException("Missing the required parameter 'updateAliasOptions' when calling updateAlias(Async)");
}
return updateAliasCall(aliasId, updateAliasOptions, _callback);
}
/**
* Update an email alias
*
* @param aliasId (required)
* @param updateAliasOptions (required)
* @return AliasDto
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
</table>
*/
public AliasDto updateAlias(UUID aliasId, UpdateAliasOptions updateAliasOptions) throws ApiException {
ApiResponse<AliasDto> localVarResp = updateAliasWithHttpInfo(aliasId, updateAliasOptions);
return localVarResp.getData();
}
/**
* Update an email alias
*
* @param aliasId (required)
* @param updateAliasOptions (required)
* @return ApiResponse<AliasDto>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
</table>
*/
public ApiResponse<AliasDto> updateAliasWithHttpInfo(UUID aliasId, UpdateAliasOptions updateAliasOptions) throws ApiException {
okhttp3.Call localVarCall = updateAliasValidateBeforeCall(aliasId, updateAliasOptions, null);
Type localVarReturnType = new TypeToken<AliasDto>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update an email alias (asynchronously)
*
* @param aliasId (required)
* @param updateAliasOptions (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 202 </td><td> Accepted </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateAliasAsync(UUID aliasId, UpdateAliasOptions updateAliasOptions, final ApiCallback<AliasDto> _callback) throws ApiException {
okhttp3.Call localVarCall = updateAliasValidateBeforeCall(aliasId, updateAliasOptions, _callback);
Type localVarReturnType = new TypeToken<AliasDto>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}