Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* MailSlurp API
* MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
*
* The version of the OpenAPI document: 6.5.2
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.mailslurp.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;
public class FormControllerApi {
private ApiClient localVarApiClient;
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;
}
/**
* 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
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call submitFormCall(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/forms";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
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));
}
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "API_KEY" };
return localVarApiClient.buildCall(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 {
okhttp3.Call localVarCall = submitFormCall(to, subject, redirectTo, emailAddress, successMessage, spamCheck, otherParameters, _callback);
return localVarCall;
}
/**
* 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=[email protected]` 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=\"[email protected]\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://java.api.mailslurp.com/forms?_to=[email protected]\" 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
Status Code
Description
Response Headers
200
OK
-
*/
public String submitForm(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters) throws ApiException {
ApiResponse 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=[email protected]` 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=\"[email protected]\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://java.api.mailslurp.com/forms?_to=[email protected]\" 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
Status Code
Description
Response Headers
200
OK
-
*/
public ApiResponse 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(){}.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=[email protected]` 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=\"[email protected]\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://java.api.mailslurp.com/forms?_to=[email protected]\" 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
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call submitFormAsync(String to, String subject, String redirectTo, String emailAddress, String successMessage, String spamCheck, String otherParameters, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = submitFormValidateBeforeCall(to, subject, redirectTo, emailAddress, successMessage, spamCheck, otherParameters, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}