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

com.mailslurp.apis.ContactControllerApi Maven / Gradle / Ivy

Go to download

Official MailSlurp email API - create real inboxes then send and receive emails and attachments from tests and code.

The newest version!
/*
 * MailSlurp API
 * MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.  ## Resources  - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
 *
 * The version of the OpenAPI document: 6.5.2
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.mailslurp.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;

public class ContactControllerApi {
    private ApiClient localVarApiClient;

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

    /**
     * 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
     
Status Code Description Response Headers
201 Created -
*/ public okhttp3.Call createContactCall(CreateContactOptions createContactOptions, final ApiCallback _callback) throws ApiException { Object localVarPostBody = createContactOptions; // create path and map variables String localVarPath = "/contacts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); 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 = { "application/json" }; 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 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)"); } okhttp3.Call localVarCall = createContactCall(createContactOptions, _callback); return localVarCall; } /** * 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
Status Code Description Response Headers
201 Created -
*/ public ContactDto createContact(CreateContactOptions createContactOptions) throws ApiException { ApiResponse 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
Status Code Description Response Headers
201 Created -
*/ public ApiResponse createContactWithHttpInfo(CreateContactOptions createContactOptions) throws ApiException { okhttp3.Call localVarCall = createContactValidateBeforeCall(createContactOptions, null); Type localVarReturnType = new TypeToken(){}.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
Status Code Description Response Headers
201 Created -
*/ public okhttp3.Call createContactAsync(CreateContactOptions createContactOptions, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createContactValidateBeforeCall(createContactOptions, _callback); Type localVarReturnType = new TypeToken(){}.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
Status Code Description Response Headers
204 No Content -
*/ public okhttp3.Call deleteContactCall(UUID contactId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/contacts/{contactId}" .replaceAll("\\{" + "contactId" + "\\}", localVarApiClient.escapeString(contactId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); 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, "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)"); } okhttp3.Call localVarCall = deleteContactCall(contactId, _callback); return localVarCall; } /** * 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
Status Code Description Response Headers
204 No Content -
*/ 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
Status Code Description Response Headers
204 No Content -
*/ public ApiResponse 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
Status Code Description Response Headers
204 No Content -
*/ public okhttp3.Call deleteContactAsync(UUID contactId, final ApiCallback _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 search Search terms (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 getAllContactsCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, String search, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/contacts/paginated"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); 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)); } if (search != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); } 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, "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, String search, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAllContactsCall(page, size, sort, since, before, search, _callback); return localVarCall; } /** * 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) * @param search Search terms (optional) * @return PageContactProjection * @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 PageContactProjection getAllContacts(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, String search) throws ApiException { ApiResponse localVarResp = getAllContactsWithHttpInfo(page, size, sort, since, before, search); 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) * @param search Search terms (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
Status Code Description Response Headers
200 OK -
*/ public ApiResponse getAllContactsWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, String search) throws ApiException { okhttp3.Call localVarCall = getAllContactsValidateBeforeCall(page, size, sort, since, before, search, null); Type localVarReturnType = new TypeToken(){}.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 search Search terms (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 getAllContactsAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, String search, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAllContactsValidateBeforeCall(page, size, sort, since, before, search, _callback); Type localVarReturnType = new TypeToken(){}.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
Status Code Description Response Headers
200 OK -
*/ public okhttp3.Call getContactCall(UUID contactId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/contacts/{contactId}" .replaceAll("\\{" + "contactId" + "\\}", localVarApiClient.escapeString(contactId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); 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, "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)"); } okhttp3.Call localVarCall = getContactCall(contactId, _callback); return localVarCall; } /** * 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
Status Code Description Response Headers
200 OK -
*/ public ContactDto getContact(UUID contactId) throws ApiException { ApiResponse 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
Status Code Description Response Headers
200 OK -
*/ public ApiResponse getContactWithHttpInfo(UUID contactId) throws ApiException { okhttp3.Call localVarCall = getContactValidateBeforeCall(contactId, null); Type localVarReturnType = new TypeToken(){}.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
Status Code Description Response Headers
200 OK -
*/ public okhttp3.Call getContactAsync(UUID contactId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getContactValidateBeforeCall(contactId, _callback); Type localVarReturnType = new TypeToken(){}.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
Status Code Description Response Headers
200 OK -
* @deprecated */ @Deprecated public okhttp3.Call getContactVCardCall(UUID contactId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/contacts/{contactId}/download" .replaceAll("\\{" + "contactId" + "\\}", localVarApiClient.escapeString(contactId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @Deprecated @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)"); } okhttp3.Call localVarCall = getContactVCardCall(contactId, _callback); return localVarCall; } /** * Get contact vCard vcf file * * @param contactId (required) * @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 -
* @deprecated */ @Deprecated public void getContactVCard(UUID contactId) throws ApiException { getContactVCardWithHttpInfo(contactId); } /** * Get contact vCard vcf file * * @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
Status Code Description Response Headers
200 OK -
* @deprecated */ @Deprecated public ApiResponse getContactVCardWithHttpInfo(UUID contactId) throws ApiException { okhttp3.Call localVarCall = getContactVCardValidateBeforeCall(contactId, null); return localVarApiClient.execute(localVarCall); } /** * 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
Status Code Description Response Headers
200 OK -
* @deprecated */ @Deprecated public okhttp3.Call getContactVCardAsync(UUID contactId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getContactVCardValidateBeforeCall(contactId, _callback); localVarApiClient.executeAsync(localVarCall, _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
Status Code Description Response Headers
200 OK -
*/ public okhttp3.Call getContactsCall(final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/contacts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getContactsValidateBeforeCall(final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getContactsCall(_callback); return localVarCall; } /** * 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
Status Code Description Response Headers
200 OK -
*/ public List getContacts() throws ApiException { ApiResponse> 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
Status Code Description Response Headers
200 OK -
*/ public ApiResponse> getContactsWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getContactsValidateBeforeCall(null); Type localVarReturnType = new TypeToken>(){}.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
Status Code Description Response Headers
200 OK -
*/ public okhttp3.Call getContactsAsync(final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getContactsValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy